Dark sides of Laravel

Forewords

I am highlighting a situation in this article which must be a core concern for whole PHP community. I want my readers to read the article with patience till last word. I am a PHP lover but i am presenting an important case here, so read thoroughly and ponder on all aspects.

Introduction

As being a Solution Architect i encounter questions from Businesses and Software Engineers like “Why PHP instead of .NET (Core) ?” Anyone can answer that with substantial reason.

On the other hand, it becomes a challenge to satisfy businesses and developers on the question “Why Not ASP.NET (Core), But Laravel?”

When we ask Businesses / Recruiters, “Why Laravel?” they say “Because there are more Laravel Developers around”.

Things go worse when Laravel Developers has to end up a debate with this argument “Laravel is preferred PHP-Framework because there are more Jobs in Market related to Laravel”. So this forms a Cyclic Dependency on Laravel which is the best among the worsts frameworks.

Competing The Best Among the Worsts:
Before i explain why i see Laravel as “Best among the Worst Frameworks” i want to clear a bad illusion that “Containerization” can somehow enable the worst technology to make its place in competition with powerful technologies". The fact is that no dimension of scaling can help intrinsically weaker technology to come in competition with good technologies.

Therefore, i am highlighting here the weaker sides of hyped Laravel and also highlighting the wisdom in using “compiled” PHP Frameworks like “Swoole” and “Phalcon”.

Complexities with Undemanded Library Support
Laravel talks about huge support for third-party Libraries.
However, external libraries can always be easily downlaoded and configured in any PHP App, quickly in fewer minutes, with the help of three-worded Composer command, and that on the basis of “Get It Only When Needed”.
So, Laravel provides nothing “out-of-the-box” here, instead it ships with a confusingly huge stack of libraries most of which will never be used in a particular PHP App. (So this reasoning nullifies within PHP echosystem itself).

One of numerous examples is Phinx. Phinx is a free, and flexible Database Migration library for any PHP Project.
https://phinx.org/

Obsolete Architecture:
The key role of any framework is to provide a Architecture to an Application for better “Maintainability”. Laravel exposes an older “Model-View-Container (MVC)” Architecture. MVC is well known as a “Monolithic Architecture”.

Unlike MVC, a Hybrid-MVC (HMVC) Framework supports “Granularity” (Bounded-context) through “Componentization”.
Then there is another modern architecture “Microservices Architecture” which supports light-weight REST-based web-services around “Micro-/ Components” so it is easier to convert Components-based App into Micro-services.

Laravel’s Lumen ?
Laravel’s Lumen is Laravel’s Micro Framework. Just like all Micro-frameworks, it allows to implement functionality in PHP (in the form of REST-API) where the use of Model/s, View/s, and Controller/s is just optional.

Here, the question that takes the shape is that if we want to choose a Micro Framework then why an “interprered” (sluggish) Micro Framework ? over a “compiled / faster” Micro Framework ? (Like, Phalcon or Swoole).

Asynchronous Programming Paradigm
.NET (core) is a “compiled” platform (with its JIT) hence faster, resource-efficient, and now available across multiple OS platforms. .NET (Core) supports “Asynchronous programming paradigm” natively.

On the oher hand, “Swoole” is also a “compiled framework for PHP” which allows Asynchronous / CSF programming and Network programming. As we know, PHP takes its lead over .NET (Core) or JAVA due to its popularity in its “Ease of Learning / Use” (due to “Dynamic Data Typing”), therefore PHP wins here as being the best trade-off between “Application Performance” and “Developer’s Productivity”.

While “Swoole” itself remains among the world’s top highly performing frameworks, when blended with “Laravel”, Laravel does not gain any significant boost in its sluggish performance (Sluggish Throughput).
See the ranks on Techempower Benchmarks:

Quick Development with Dev Tools:
“Dev Tools” in a framework provide quick / handy way to do grunt-work. Laravel is not the only framework that provides Dev Tools. For example, Phalcon (a compiled PHP Framework) also provides Dev Tools for Rapid Development.

Laravel Documentation ?
It is often told that Laravel’s Online Documentation is exceptionally good which is astonishingly not bad or better than any other PHP Framework.

For Example, Phalcon’s Documentation is sufficiently enough to solve any problem. It is a well-organized and comprehensive online documentation, along with quick support from owners, contributors and from forums.
On the right-side there is a detailed Menu:

Ease of Learning ?
As compared to Laravel (which confuses new developer with its huge stack of External Libraries), learning Phalcon Micro (for modern Micro-services) is only a one-paged learning which should take no more than a four hours to understand even for a new PHP developer.

Any new PHP Developer should be able to create Microservices with Phalcon Micro within a day as it is easy as well as interesting.
Then the journey from Phalcon Micro to Phalcon Full-stack (HMVC) becomes even more easier.
Check this out by yourself:

Conclusion:
While it is scientifically true that the “compiled” PHP Frameworks like “Swoole” and “Phalcon” provide a way for PHP to stay in competition with other technologies (like .NET Core, Java and Node.js), Laravel is just “Best among the Worst PHP Frameworks” due to which .NET (Core), Java and Node.js will continue to sweep PHP market quickly.
“Asynchronous” and “Compiled” PHP-Frameworks are the only ray of hope for the Future of PHP.

Moved post to Laravel from Swoole.

Done. Thanks.

1 Like