Which framework do you prefer and why?
I'm working currently exclusively with Symfony but I want to take a look on laravel next year.
Laravel literally runs on Symfony.
So ask yourself, you I need the safety net of the opinionated framework of Laravel? Or do I have the time and energy to create my own opinionated architecture using Symfony?
Happens to me all the time with React boilerplates like MERN or Apollo stacks. You wonder if life would be easier with one, download it for a day, then realize you could have written it yourself without half the dependencies and documentation. Or on the flip side -- you're tight on time, and you get the job easier with a predefined scaffolding.
How come 90% of the poll is for Laravel and all the replies/comments advocate for Symfony ? 👹
What kills it for me about Laravel is some design choices such as static and tight coupling which makes it way harder to work with. Twig over Blade too, for the community/spread.
One possible reason maybe: Laravel is very popular in the US (which seems to be the major audience of hash node) but from what I’ve seen has less traction in Europe and especially France 🇫🇷.
I personally prefere Symfony over Laravel just because I think they made more reasonable design decisions and implemented Patterns more accordingly to what I deem a good Decision.
Still Marco Alka made a good point about understanding Frameworks first as well as Oscar Diaz who made a good point about the timeline issue as well as other concerns like maintainability, specialization and longterm security support.
Laravel seems to be easier, that's why so many PHP people love it. just as a baseline
Symfony oriented itself on the Spring framework architecture (java), it is inspired by jinja (python) for their twig tpl language and Doctrine is a Data-mapper pattern which orients itself more along the line with Hybernate.
Laravel oriented itself more along the line of Ruby on Rails architecture (ruby), it uses Blade as default template language and it has Eloquent as an ORM which is as well Ruby oriented with an Active Record pattern.
I personally use phalcon, symfony, my own and yii as frameworks in PHP tried parts of CakePHP, Codeigniter as well and a lot of self tailored PHP-Frameworks.
Hence I cannot say anything about laravel besides a lot of people love it and all the talks in the usergroups about symfony and laravel have been great so far.
But to the real point, .... if possible I would always pick separated libraries over complete frameworks for my personal use.
CodeIgniter,
because it lets you use other libraries without trying to make you conform with their coding rules.
Marco Alka
Software Engineer, Technical Consultant & Mentor
Let me give you some advice for whenever you wonder which framework to use: Don't be the guy who uses his hammer for everything, because at some point you have to put a screw into a wall - and believe me, screws which have been hammered into a wall will remember their mistreatment and swear vengeance.
Instead, first learn how to do things with your hands, learn in which situation to use what tool and especially why they are handy to do that particular job. Then, get a tool belt of many different utilities, which you can pull out when you really need them, not because you want to look "kool" with an hammer in your hand.