Laravel and Symfony

I have felt slightly uneasy in the last few days with the status of Laravel. There was some Reddit based drama (when is there not I hear you ask?) at the weekend. tl;dr - Laravel effectively deprecated a simple (yet possibly too basic) auth boilerplate and possibly didn’t communicate this in the best way. The recommended boilerplate is now to use a JS/REST framework like Inertia or Livewire… which for some is heavy handed.

I understand that Laravel is opinionated and has become popular because of this. It has made PHP cool again and I still think it’s great for building apps in the vast majority of cases. But… (you knew there was a but coming, right?)…

…the API for Laravel has become rather large now, convenience methods are great, but I end up spending so much time looking for the right way to do things I’m actually slowing my coding.

Laravel leverages a lot of Symfony components, so I’ve been reading up on what it offers, and I must say, it’s pretty good. Not as many bells and whistles, but it seems to do a lot more than I had thought. (It even has tooling to build/minify front-end assets.)

Would I write more code with Symfony? Probably.
Would I up my coding skills in the knowledge that I don’t have the training wheels of “use that controller… this goes in that method… etc” - quite likely.

Has anyone else stepped down from a framework with lots of abstraction to something more literal where you don’t get everything thrown at you?

I’m inclined to give the grey matter a work-out…

I have yet to use the new Laravel 8/Jetstream stuff but I have been following the drama associated with it.

Taylor did a live q&a about it, I read a transcript of it somewhere on Reddit but can’t find it now - but here’s the original video

He’s confirmed Laravel UI is not deprecated so you can continue to use it.

It’s clear Jetstream / Fortify is what will be encouraged, but I’ll hold off on forming an opinion on it until I’ve tried it. To be honest, I probably wouldn’t switch to Symfony, although I know it’s a good framework. I’d rather not have to learn another PHP framework unless I really have to :sweat_smile:

Yes, I saw the video and it did go some way to explaining his reasoning. I can understand him wanting to hand off a “vanilla” authentication front end to the community if he’s not intending to maintain it. That could have been communicated better. I’m sure someone will build an updated plain front end auth system.

Fortify is definitely a step up - I think Jetstream is going to be great for people wanting to make a SaaS app quickly.

I set up a demo Symfony app the other night… it’s not too different and was somewhat encouraging. Most of the core stuff in Laravel is Symfony anyway (such as HTTP Responses), it just has more nice things around it.

I’m going to continue looking at Symfony - I can see it has some merit.

I think this is why Symfony Flex as standard was such a great idea.
Take something as small as Slim to start, build out the components as necesssary.

1 Like

Yes, it had been so long since I looked at Symfony that I hadn’t realised how far it had developed.

They even have Webpack-based front end tooling with Webpack Encore.

I’ve read Symfony 5: The Fast Track (written by Fabien Potencier, you don’t get more knowledgeable than that!) and now I’m about half way through working through the book as I code along with the examples. I’m very impressed with what it offers and I feel less pressured to follow the “right way” of doing things. Yes, there are certain methodologies that are best practice, but beyond that you can code as you desire.

The book is really good, I had an “oooohhhh noooo” moment when I saw that it wanted me to use Docker (tried in the past, never really had much success), but it has all worked first time! The source code examples in the book are generated from accompanying Git repository which is super cool that if the book gets updated it will always work if you checkout the right version from the repository! :slightly_smiling_face:

There is a recently released book in the Laravel world from Spatie’s Freek Van der Herten titled “Laravel: Beyond CRUD”.

Only timewasters occupy their time attempting to stand their ground and fight between the two - the important thing is that both frameworks do what they do well and what they were designed to do.

1 Like

Indeed, and as Laravel uses many Symfony components they’re of the similar viewpoint.

There’s some great content being made by users of both frameworks :slight_smile:

On that particular point, Laravel is seemingly trying very hard to migrate as much of Symfony out of it as possible. At this point there isn’t actually a great deal of components in there anymore - most have been rewritten or depricated. There’s another argument as to whether that’s the right approach, but considering I think both have left the PHP-FIG now, Symfony’s console is not open source and recent controversial ousting of core contributors - and Laravel has a habit of taking open source stuff and rebranding it as a Laravel product (tinker, homestead, vapor, etc etc) I think both have their own faults.

I remember there being some drama with PHP-FIG a couple of years ago when some people left it.

I suppose when anything gets to a certain scale and more people are involved you’ll find some differences of opinion!

there’s always drama. Drama in the FIG, drama in Internals. Most of the ecosystem I know now in the speaking circuit tend to just stay away from it and let people bicker. The recent Laravel incident on Jetstream critisism is one. People moaned, Otwell didn’t like it, toys out of the pram both sides, how much does this actually affect my life? Meh.

Proudly sponsored by Bytemark