Skip to content
macropay-solutions edited this page Jun 4, 2025 · 7 revisions

Maravel — a PHP framework oriented towards dependency injection

1. What Is Maravel?

2. What Is Maravel For?

3. What Problem Does Maravel Solve?

4. What Design Principles Underlie Maravel?

5. What Packages Are Compatible With Maravel?

1. What Is Maravel?

Maravel is a template for Maravel Framework that was inspired by Lumen 10.0.4 and Laravel Components 10.48.29.

2. What Is Maravel For?

Maravel can be used for microservices or services just like Lumen, which is kind of abandoned by Laravel.

Comparing it with a Laravel 10 for our AUTO cruFd libs suite, it is faster:

From ~800 ms to ~600 ms when the "server" is busy and from ~300 ms to ~200 ms when "server" is not too busy when listing 1000 operations from a MYSQL DB (without OPCACHE enabled).

Thanks to the improvement in the Container, even if we resolve the classes that use the Macroable trait from container instead of using new, the response times are faster compared to a full Laravel.

Also with the introduction (in the template not in the framework) of config:cache and route:cache (that were not present in Lumen) the response times will decrease even more (for example minus 30-40 ms per request on last route out of more than 500 registered routes).

3. What Problem Does Maravel Solve?

Keeping up to date with Lumen on a yearly basis can be a cumber-stone when the version that you are using has no known bugs or vulnerabilities.

Sometimes updating to newer versions will fix some bugs but, may also introduce new ones.

To solve this issue, we started from the last STABLE, (KNOWN) VULNERABILITY FREE and UNMAINTAINED version of Lumen (that will be using max PHP 8.3 and Symfony components 6.4 LTS supported until the end of 2027) and introduced the idea of stopping the overhead that gets into the core and only update in the future for the following reasons:

  • PHP version,
  • Symfony components LTS versions
  • And possible missed classes that would need to be resolved instead of instantiated directly,

allowing new features and bug fixes via packages, to maintain a stable core that does not need to be updated yearly.

By doing this, Maravel puts the power (ability to act) in the developer's hands.

4. What Design Principles Underlie Maravel?

Dependency injection will bring USABLE inversion of control and allow the developer to extend and/or overwrite functionalities from the core framework.

Compared with Lumen, the app helper can be used also with list for construct arguments:

//        $guard = new SessionGuard(
//            $name,
//            $provider,
//            $this->app['session.store'],
//        );

// Lumen/Laravel only way
        $guard = \app(SessionGuard::class, [
            'name' => $name,
            'provider' => $provider,
            'request' => $this->app['session.store']
        ]);

// Maravel alternative way
        $guard = \app(SessionGuard::class, [
            $name,
            $provider,
            $this->app['session.store'],
        ]);

5. What Packages Are Compatible With Maravel?

All the packages compatible with Lumen 10.x should work also with Maravel 10.x because the Illuminate namespaces are preserved.