r/PHPhelp • u/oqdoawtt • Dec 18 '24
New Project. Which Backend Framework?
Hi everyone. Normally I use the Phalcon Framework for all my projects. Currently there is a rewrite going on to pure PHP. The Team is small and I do not have the luxury to wait until the rewrite is finished and also tested and viable for production use.
The new project is mostly a REST API backend and heavily uses background jobs and events/triggers.
So I am looking for a new Framework and currently thinking about the following:
- Laravel
- Spiral
- Symfony
- Tempest
My thoughts:
Laravel: Many developers use it. It has a huge community and a rich ecosystem. There are some things in the pipeline I am interested in, like nightwatch.
Spiral: Spiral has tight integration with roadrunner and temporal. The community is smaller. Just by looking at their discord I feel not really confident with it.
Symfony: People here will hate me for that. But from all those Frameworks I have the most concerns with Symfony. The ecosystem is really expensive. Especially blackfire.io. Also many developers seem to enjoy using Laravel over Symfony. It feels like a cult to me and really scares me off.
Tempest: The new player on the field. I like the overall style of the framework and can already imagine rapid development with it, because most of the stuff will happen automatically. Sadly it is still in alpha/beta and for example a queue manager is still missing.
If you would be in my position and are free to choose. Which one would you choose and why? Or would you use something different?
15
u/allen_jb Dec 18 '24 edited Dec 18 '24
(To be clear here: While I am personally not a fan of Laravel, I have nothing against its use as such - I understand why people use it and have no real problems with that. My problem here is the particular phrasing used comparing aspects of Symfony and Laravel and their ecosystems / communities in this post)
While Blackfire might be linked from Symfony's site, it's really just a generic APM / monitoring service similar to Sentry or NewRelic. To the best of my knowledge, there's nothing Symfony specific about Blackfire, and nothing specific to Symfony that prevents or impedes you from using other similar services.
(And why do you have a problem with Blackfire here, but not Laravel Nightwatch, which will probably be similarly priced if it has a similar level of features)
Symfony is a fully open source framework, much of which provides a base for much of Laravel (among others).
From what I've seen, Laravel markets premium services (both directly from Ortwell, and other, often closely affiliated third parties) much harder than Symfony, or pretty much any other framework I've encountered, with the possible exception of the now dead ZendFramework (reincarnated as Laminas, without the Zend marketing)
And Symfony feels like a cult, but Laravel doesn't?!?! While not as bad now (I believe mostly because it's achieved "name brand" status and the significant momentum that comes with that), the cult-like behavior of Laravel followers achieved a meme-level status I have never seen in any other PHP framework.
Laravel has higher name recognition because it was heavily marketed, gained traction through use in a lot of bootcamps, and is often the only framework many of the developers who use it actually know, to the point they often don't really know PHP - they just know Laravel (this is a similar phenomenon previously seen mostly among WordPress developers, but also in those of some RAD frameworks like CakePHP)
While tools / extensions / third party services "for Laravel" may often seem easier to find, this often links back to the commercial marketing I mentioned above. Many (most) of these tools / services are really just a pretty wrapper over those already available elsewhere. The Laravel versions often provide less flexibility. I believe you should also beware of the vendor lock-in problem here.
Laravels fully open source "components" are often much more tightly bound to other components of or the Laravel framework itself, making it much harder to use or switch to alternatives when the Laravel versions don't meet your needs. While the Symfony components often (via documentation) nudge you towards using them within Symfony projects / with other Symfony components, they're frequently much more flexible and can be used within other environments or swapped out with other libraries much more easily. You won't often find Laravel components / libraries being used outside of Laravel projects, but you will find Symfony components / libraries frequently used in other, non-Symfony, projects (include Laravel)
4
u/mrdarknezz1 Dec 18 '24
Laravel or symfony will give you whatever you need. I personally prefer laravel but I think it’s a matter of taste and how you like to structure your projects
2
u/Linaori Dec 18 '24
About to finish migrating a project from Laravel to Symfony. I will never touch Laravel again. The amount of magic that makes code hard to understand and sometimes only possible through docs, made me want to quit my job several times while working on it.
I now understand why JS ecosystem devs like it..
1
u/equilni Dec 18 '24
The usual recommendations will be Laravel or Symfony and you can't go wrong with both.
It's your preference after review - if the style/ecosystem works with your team and project, then for future growth (other devs (see the other comment on this) and/or expansion
I would look at the recommendations, compare each and talk it over with your team.
Obvious example of comparing like things between what you are used to (whether you used this or not) and likely candidates:
https://docs.phalcon.io/5.8/db-models-events/#events
https://www.doctrine-project.org/projects/doctrine-orm/en/3.3/reference/events.html
https://laravel.com/docs/11.x/eloquent#events
https://laravel.com/docs/11.x/broadcasting#model-broadcasting
Tempest looks really nice. I haven't tried a POC with it yet.
1
u/terremoth Dec 18 '24
Laravel without thinking twice in this case
1
u/minn0w Dec 18 '24
Heh, I always felt laravel was the cult.
But you can't go wrong with either Laravel or Symfony. IMHO Laravel has a steeper leaning curve, but can produce simpler results quickly. And Symfony is a bit easier for complex things but more verbose.
If it's a full rewire, and there's no technical concerns, I'd go with Laravel in your situation.
I have never used Tempest or Spiral in anger though.
1
u/TolstoyDotCom Dec 18 '24
Drupal is based on Symfony and you don't have to recreate user/role/permissions/tags/categories/content/etc/etc management. It has a steep learning curve but there's lots of help available on the Drupal site, on Stack Overflow, on Reddit, and on Slack. See the 'examples' module to get you started.
2
u/steinkel_ftw Dec 18 '24
I would add CakePHP to your list, it provides all you need for a web app project, without a lot of the complexity of other frameworks. Also the ORM is the best one, for me.
2
u/[deleted] Dec 18 '24
I insert my five kopecks
Laravel, due to its dependence on most Symfony packages and others, can take a long time to run and in order to achieve a server response result of 200ms, you will have to work hard, often just installing jit will not be enough, and faster speed is even more difficult to achieve
1
u/YahenP Dec 18 '24
Hmm... I would choose the framework that your team knows. If the team knows and can use both frameworks (Symphony and Laravel), then... I would choose Symphony. Because I like it more. That's the only reason. No objective reasons. Although... Doctrine, Validators, and Symphony Forms are great.
Spiral .... well. It's an interesting thing. But quite niche. The documentation is somewhat sparse, but the framework is very similar to Symphony. Plus, it can integrate Symphony components well. But if the developers have never written server applications with an event loop, and are only familiar with the "start, return result, and die" pattern, then it will be difficult.
But in general, I will repeat once again: all frameworks are very similar. Any one is suitable for any task. The main thing is whether the team knows the framework. This should be the reason for the choice.
1
u/rjrjnznz Dec 18 '24
I’d recommend Laravel, very large community. Easy to get things done quickly. Many good Laravel tools to help you get things done, sail, telescope etc
1
u/lifewcody Dec 20 '24
Spiral.
We were a PhalonPHP shop for a long time. Not going to lie, it’s going to take some getting used to, but ever framework does. The community is small, but the devs are in discord and respond to everything in a good time frame.
The road runner integration is 🔥
I didn’t like laravel because you can’t stripe the “magic” components out of it, with spiral you know exactly what is and isn’t loaded.
0
u/[deleted] Dec 18 '24
[deleted] — view deleted comment