DEV Community

Valentin Silvestre
Valentin Silvestre

Posted on

Why is Laravel much popular in USA than Symfony ?

I'm a big PHP lover (I know...) and I know that Symfony is way better in such way.
Why do people don't use Symfony instead of Laravel ?

Top comments (16)

Collapse
 
tbyte profile image
tbyte • Edited

If you like OOP, encapsulation, clean and well structured code, testability then yes, Symfony is the better solution because Laravel violates all of this principles.

It propagates a false simplicity. It bypasses object orientation massively with its facades , its ORM and its magic nonsense.

The ORM (Eloquent) barely deserves the name as it delivers Model classes which are not much more than associative arrays. Since the ORM does not know your columns it's not capable to tell if one exists or not - it will just fail on save. Apart from column access there is more magical stuff happening with mutators. This whole lib is one of the biggest pile of junk I've seen in a long time, and it implements the Active-Record antipattern. Nuff said I guess.

Blade is not bad but pointless. It can't do anything, twig can't do just as good or better. Also it's not running in a sandbox and allows everyone heavy php code usage in the templates which can lead to a huge mess when inexperienced developers are involved in the project.

IoC / Dependency injection is good, and was actually better than Symfony's approach for a long time because of the powerful auto wiring. You can inject anything into anything without messing with config files or declare services. Symfony is closing the gap now but still Laravel has an edge here.

Vue.js integration / Laravel-mix is great. I'm using it in Symfony where it integrates just as well.

Collapse
 
pictor13 profile image
Igor Pellegrini • Edited

Not saying what's written above is not true, but the whole answer feels like strongly biased; especially because it's not really an answer to the question but just a big praise to Symfony.
Also, IMO, is written from an account that looks like a facade:
no comments on DEV; Github account exists since 2012 and has no single activity since then.

Collapse
 
dennismerrell86 profile image
Dennis Merrell

Luckily Symfony sticks to "good principles" like chucking string event names left and right....

Collapse
 
makiten profile image
Donald

Where I lived, Symfony was de facto among PHP frameworks at startups. Laravel took over when the local coding bootcamp and some new startups used Laravel.

Laravel appears to be easier to get started with and learn (mind, I used to like CakePHP a lot when I was heavily using PHP, so at the very least, I used to survey frameworks), and the community of Laravel makes a big difference.

One of the enterprise cos here also uses Vue, so that would be an enterprise-level interest in using Laravel over Symfony.

That said, I never used Laravel at all, and I've built products in production using Symfony. By the time Laravel was en vogue where I live, I was forced to use .NET professionally, and I was trying to insert Python where I could. A few opportunities came my way for Laravel, but despite the reasons above for choosing the framework, the startups here hiring Laravel devs seem to forget about that.

Collapse
 
vasilvestre profile image
Valentin Silvestre

You live in France ? ^

Collapse
 
makiten profile image
Donald

No, I live in the US.

Thread Thread
 
vasilvestre profile image
Valentin Silvestre

We're experiencing the same thing in France. Startup love Laravel because it's easier to understand and faster to start a project..

Collapse
 
antjanus profile image
Antonin J. (they/them)

I've used both and I largely prefer Laravel. There are a few main reasons for that:

  1. Laravel is MUCH easier to bootstrap. There are no xml files, no dependency injection crap.
  2. Laravel is easier to learn. You can pretty much bypass the MVC pattern if you want to and dig as deep as you need to.
  3. Tons of magic. Because of Laravel's heavy use of facades and static methods, it requires less amount of boilerplate
  4. Community is amazing and constantly evolving
  5. There are lots of integrations and full-stack solutions. Laravel integrates really well with Vue, giving a PHP developer an "in" into JS.

There are more reasons but those are my main ones. I like Symfony as well and I think it's great for large enterprise applications. I've use Symfony in that context and it works well; however, trying to wire in a new bundle or library takes effort to learn the xml and bootstrapping system while with Laravel, I've noticed I didn't have to really do that.

Collapse
 
vasilvestre profile image
Valentin Silvestre

These points are now invalid because of many evolves. The new Symfony have easier dependency injection with annotation or type hint!
It's true that Laravel is much easier.
Magic is something I don't like, newcomers don't get how FW work when there's too many magic.
The community is the same as the Symfony one I think, their Slack is active, the github have so many pull request, etc...
It's kinda same with product like API platform, both Sf and Laravel have blade/twig.. Maybe your own experience so

You should try Symfony 4 with Flex, it comes with many handsome features, auto config, powerful type-hint, internationalization of url and more.. Even add bundle is easy now. That's what make Symfony better in my opinion, they are making big evolve that allow you to make a little or big project.

But in fact, Symfony need a lot of time to learn how to use it.

Collapse
 
defman profile image
Sergey Kislyakov

And by what criterias you're making your assumption about what's better or not? I guess most people don't find "better" things of Symfony that better than Laravel's "better" things so this is the reason why Symfony is not used as much as Laravel.

Collapse
 
vasilvestre profile image
Valentin Silvestre

Because I've made research, they both have advantages.
But for any big project, Symfony is way better.
And Symfony 4 is now light and heavy, as you need.
Symfony is now more flexible than Laravel, the community is doing much work...
And also, I've experience where Laravel was so limited.

Collapse
 
verzola profile image
Gustavo Verzola

Mostly because it is easier to use, faster to start, it has a nice documentation and still can evolve well into a big application.

Collapse
 
vasilvestre profile image
Valentin Silvestre

I've seen case where Laravel wasn't able to grow more. I've never seen that case with Symfony.

But yes, it's easier to start. Faster to start I'm not sure, with the new Symfony flex it's really fast now.

Collapse
 
verzola profile image
Gustavo Verzola

When I said it can evolve well into a big application I mean in code organization, not performance. It supports from the most basic type of application that has everything on routes.php and facades to a more enterprise like application that uses dependency injection backed by unit and functional tests. But if performance is a concern I would not choose Laravel.

Thread Thread
 
vasilvestre profile image
Valentin Silvestre

The code organization was also a problem in my experience.
But it's maybe depend of the team, I wasn't involved into the development. I just casually helped a friend.

Collapse
 
robertomanchado profile image
Roberto Manchado

Maybe are Juniors programmers, may be Laravel have good face and marketing, but in fact Laravel had been built over components of Symfony.