DEV Community

Kevin Naidoo
Kevin Naidoo

Posted on • Updated on

Laravel is a mess?

I Love Laravel; I have been using it for years. This is not a rant, just a thought on where the future is with Laravel.

I think there is too much magic happening. Looking at views for example:

  1. Blade.
  2. Interia.
  3. Livewire.
  4. Volt. Not strictly a view layer but essentially it is writing React in PHP.

Then there are components, that make code re-usability better, however, quite often you can just use "@include" to render a partial.

When you look at the @include tag: it's fairly straightforward what is happening here. Especially if you have prior old-school PHP experience with "require_once" and "include".

I am very OCD about minimalism and structure. Laravel 5 was good with sticking to just MVC and a minimal set of features. This allowed for good standardization across various projects.

Now, depending on the developer and team, there are major differences in implementations. Some use Livewire, some use Interia, some use stock standard blade templates, and others components.

Even with Livewire 3, I noticed some differences between minor versions. Where some functionality works in V3.2 but not in V3.3+. Not to mention V2 and V3 are vastly incompatible.

Are we heading towards a modern-day version of Spaghetti code?

What do you think? Why Laravel over Django or other backend frameworks?

🗨️ Django I like a lot, but not so much Python. Mostly because Django is very strict with its structure and maintains good backward compatibility.Read more here on why I think Django is the best web framework.

Top comments (2)

sakib3201 profile image
sakib ahamed shahon

The magic behind Laravel is still a choice. You can choose to not implement most of it. So I still think its a great tool. Establish what will be used prior and stick to it. Usually solves most issues, except the one with version changes.

kwnaidoo profile image
Kevin Naidoo • Edited

Thanks, this is a valid point. However, what is happening out there in businesses and various teams is a lack of proper governance. Thus in startups especially, you will find 101 different implementations, developers tend to bring in every shiny new tool that comes up.

This is back to the days of rolling out your own PHP framework. Spaghetti code was everywhere and a nightmare to maintain.

We accepted Laravel as the standard, as well as PSR. The goal was to provide MVC and some basic convenience. Laravel is now looking like it's heading in the direction of WordPress (maybe not that drastic but not very far off).

Meanwhile Django for example, most Django projects follow a consistent standard and it's been this way since forever. Thus in terms of governance, Django out of the box enforces a certain standard that all Python devs adhere to strictly.

This then leads to much cleaner code and better structure. Furthermore, hiring less experienced developers becomes a lot simpler, because of Django's rigid structure, there are not many variations of how to structure your application, therefore if you learned the core framework - you pretty much can pick up any Django project and become productive right away.