DEV Community

[Comment from a deleted post]
 
uptoeleven profile image
Simon Brown

No.

Symfony doesn't have nearly as much magic in it. And you can do stuff with Symfony that isn't Active Record. Because sometimes Data Mapper is appropriate...

Laravel is a bit like WordPress. And when the only tool you've got is a hammer, everything looks like a nail...

 
stevenavelino24 profile image
Steven Avelino

How is Laravel like Wordpress ? The only thing they have in common is the programming language behind them.

You may not like Eloquent as the ORM, but nothing is magical in Laravel. It uses a lot of Symfony components (just look at the vendors of a Laravel project) and some principles of Symfony. And Eloquent is here to make your life easier, but you can do everything you want with simple SQL just like any proper ORM.

Laravel makes your everyday Web tasks easier, because you know how to make a CRUD, you don't have to write everything all the time. But saying it's like Wordpress is just plain wrong.

 
uptoeleven profile image
Simon Brown • Edited

Yes it uses Symfony components. That's what they're there for. But Laravel is its own ecosystem with its own way of doing things. Some of those ways aren't entirely clear to a systems developer coming from a Symfony background - for example the magic methods. That's what I'm talking about "magic" - when I load it in PHPStorm and I want to modify a particular class property but as soon as I change anything with a similar name to that class property suddenly it disappears.

Once you look under the hood you can see what's actually going on (an awful lot of reflection).

Eloquent is an Active Data implementation - using a massive God class (eek) and more magic invocation stuff. And large dollop of Doctrine ;-)

But it is what it is.

I drew the comparison with Wordpress because there is a similarity in... ethos maybe?

Wordpress is a blogging engine and, at a stretch, a decent basic CMS for sites with low numbers of articles (anything above 10,000 articles starts to kill the server). It is great for throwing together a site quickly. But Wordpress developers who've built plugins to turn it into a CRM and a marketing engine and global publishing platform quickly run up against its limitations.

Laravel is a web app framework. It does what it does phenomenally well. It was originally an attempt to remake Ruby on Rails as a PHP platform. And it follows the Ruby-on-Rails "convention over configutation" design. If you want CRUD - for heaven's sake use Laravel. If you want decent web apps, use Laravel. If you need to start doing statistical analysis on metadata and breaking out of what Eloquent gives us - you start to hit the limits of what Laravel is good for.

Yes you can just add some simple SQL (or not so simple SQL). But if you have to go down that route, maybe you have a hammer in your hand? Are you using the best tool for the job (given that "simple SQL" = "tied to a particular SQL implementation for the lifetime of the project")?

Wordpress is a great implementation framework for making blogs and basic web sites.
Laravel is a great development framework for making fairly complex, CRUD-based sites.

But it's also useful to know its limits. There are times when you need to have more tools in your box.

 
stevenavelino24 profile image
Steven Avelino

Nothing stops you from implementing whatever functions or classes you want, Laravel is still PHP. You can do ML or statistical analysis of metadata as you wish to do. Just like Symfony (or any Web frameworks for that matter), Laravel is a big toolbox that you can use. It's gonna help you greatly in some tasks and some, not so much, but it's still what it is, a toolbox, nothing stops you from going to the shop and buy another tool for what you want to achieve.

If your project needs are so complex that Laravel can't solve them, you probably just don't want to use PHP and you better use a more appropriate language