DEV Community

marius-ciclistu
marius-ciclistu

Posted on • Originally published at marius-ciclistu.Medium on

Maravel Microframework Just Got Lighter And Faster Than Ever


Maravel template and laravel-crud-wizard-free

After some struggle, I am happy to announce version 10.51.2 of the Maravel Template that uses Maravel-Framework.

It contains the minimal setup for a microservice to work coupled with laravel-crud-wizard-free (for which it needs $app->withFacades(); and $app->withEloquent(); uncommented in bootstrap/app.php).

That means without auth, because usually microservices are not public.

Initially I just added some modules to composer.json autoload.exclude-from-classmap but if the composer install is not run as:

composer install --no-dev --optimize-autoloader --classmap-authoritative
Enter fullscreen mode Exit fullscreen mode

the classes are still found even if they are not in the autoload_classmap PHP file generated by composer.

So, on a second try classes were not found anymore. I started rolling back one by one the previously excluded modules but, by doing only that I would had need to revert them all. In the end I figured that if I don’t use their bindings in \App\Application::$availableBindings and aliases in \App\Application::registerContainerAliases it will work so, I overrode those and I commented the not needed ones.

In this way the simple CRUD with auto-filter and auto-sort works with as minimal as possible overhead.

The overall changes from version 10.51.0 vs 10.51.2:


composer.json


\App\Application::registerContainerAliases


\App\Application::$availableBindings

Now the developer can fine tune from within his project the required overhead of the microframework based on his needs.

Note that this logic can also be applied to Lumen.

Top comments (0)