Laravel 5 released
laravel-news.com
laravel-news.com
https://laravel-news.com/2015/02/laravel-5-released/
It might be a better way to get an overview of this release as it links to various other articles about v5.
An article specifically on the changes:
It's hard to quantify, but I have used CakePHP, Yii, Rails (0.9 through 4), Django and plenty of home-grown 'frameworks'. From all those the most cohesive and understandable to me was Rails followed by Yii (surprisingly).
Maybe it's the docs or structure, but Rails and Yii have a strong opinion and it seems their developers have both CS smarts and industry experience, which shows in the structure and code.
I'm sure in time Laravel will mature and improve. Currently it just feels like there's a lot more hype than it merits.
I have worked with Symfony2, Zend Framework, Yii, Kohana and Laravel and find Laravel the most intuitive to work with.
I like that you can start using it for very rapid prototyping and refactor into more complicated structures as the application grows.
Well, no, because everyone would laugh at them.
Facades, macros and route closures supports rapid prototyping and are pretty easy to replace as needed. Included libraries like Flysystem, Cashier, Elixir and the new cron wrapper also eases rapid development.
There are also a few tools around it, like Homestead and Forge, that makes it easy to set something up quickly.
It's not like you can't do rapid prototyping with other frameworks, but Laravel, to me, is the first PHP framework that actively supports it while providing a flexible enough structure to grow in.
Unless Taylor gives away control of the project, I don't see it happening. It'll keep being a popular framework, though.
I can't comment on Laravel though, as my only experience with it was a negative one. I had a rejected bugfix for which Taylor decided to ignore the PHP documentation I linked to verifying the issue, and several other developers saying they have experienced the issue/would like to see my PR merged in.
I think it'll stay a popular PHP framework until the next popular framework comes around (CI => FuelPHP => Laravel).
Your framework is dead because you've continued to prove that you don't understand what PHP 5.3+ is and means. I say that as someone who has been forced to use CakePHP for ~10 years. You've always lagged far behind in the concepts that other frameworks have down pat.
And a general list of changes between the current stable and our upcoming release: https://github.com/cakephp/cakephp/wiki/3.0-Roadmap
http://laravel.com/docs/5.0/eloquent#relationships
http://laravel.com/docs/5.0/eloquent#querying-relations
> EDIT and this for making them effective
Yes, they aren't done in a single query format - which should be a problem since it may be faster just to do two simple queries then one complex.
Besides that relations could be eager loaded for when you have number of items in first query and want to load relations to all of them. With eager loading you won't have problems with N + 1 queries.
The ORM is basic yes, but that's the purpose of it. If you want a bigger one do what you do with Symfony and use Doctrine or something more robust.
I doubt there are a lot of people switching from WP though, since WP and Laravel solve two different types of problems.
But after understanding the Facade pattern that is widely used by the framework, I've concluded that the use of the static method calls is not an antipattern at all.
In a JavaEE circa 2003-5 way. Not exactly what modern programming is about...
Besides, it's not like https://news.ycombinator.com/item?id=8656965 is some gem of a comment that hasn't been written 200 other times on HN for example.
For example, the default version of Laravel 4.x shipped with the "Whoops" PHP stack trace view, which is far superior to the L5-default Symfony stack trace view. Other features were removed too, including the HTML library. Blade tags were changed for no reason.
Overall, it feels like instead of adding requested features, Taylor decided to redesign the architecture for no reason.
The "architecture" change is the bootstrap repository, which has a new folder structure. I know, scary stuff! Folders!
The "architecture" has some enhancements to middleware and fleshing out events/commands to a "command bus". Basically, you get more sugar on top of the (mostly) same architecture.
Whoops caused a lot of headaches behind the scenes, and did stupid things like convert ALL http error responses to 500, even on a 404 error (which showed up in Whoops, as HTTP errors are converted to exceptions within Symfony's HTTP stack).
Blade tags have one new tag, and the old ones still works.
This point might be the subjective one - HTML library. HTML libraries create an enormous amount of support for people's edge cases and generally are better pushed out as a third-party add on to suit your needs. The upgrade guide explains how you can add them back in if you want. https://github.com/illuminate/html
It would've been super easy to add some code that sets the HTTP code for Whoops's response if that was the problem - but the fact is you should demand your framework users define their own 404 handlers.
The old Blade tags now escape all HTML, that hardly counts as working.
1. Create feature X.
2. Users don't understand feature X, and use it when they should be using feature Y (for safety.)
3. Update the API so that feature X does what feature Y did, and create feature Z that now does what feature X did.
4. Old users using feature X incorrectly are now protected, while users who correctly used feature X must now convert to feature Z.
> In Laravel 4 Blade included the following two styles: {{ and {{{. > The double curly bracket was a raw echo and the triple curly bracket escaped. > > Now both the double and triple curly brackets escape the variable and a new {!! $var !!} is for raw.
I'd argue that having unescaped output be shorter/easier than escaped output was probably a design error in earlier versions -- but I'm not sure I like the "fix"... If it was a green-field design, I must admit I like the "danger!"-feel that unescaped output has in L5 though.
Whoops stack trace: https://laracasts.com/discuss/channels/general-discussion/wh...
Can we stop complaining? I see a ton of improvements and nicer features than the ones you are talking about in this new release.
Adding it back should be trivial http://mattstauffer.co/blog/bringing-whoops-back-to-laravel-...
I usually add the Raven PHP client [https://github.com/getsentry/raven-php] to report errors to Sentry when starting a new project and will likely do the same with Whoops by default.
I also have a bit of pride that it's made in Arkansas. Yes, we have computers and the internet here.
- it's well-documented
- it has an active community
- I simply enjoy working with it. It feels lightweight, although it probably isn't, if I take a good look at the "vendor" folder and the dependencies
- I get stuff done relatively quickly
Edit: So I started porting my small Laravel 4 project to 5 and to be honest, my first impression is: Laravel 5 is more like Zend Framework than the small and nice PHP framework. It lost a bit of its lightweight flair for a potentially more structured architecture, but I kind of hate to put everything in "Service Providers" and "Middleware" and whatnot.
E. g. before, you had a folder "app/controllers", now you have "app/Http/Controllers" and "app/Http/Middleware" and "app/Http/Requests". While this might make sense for bigger projects, it also loses a bit of its lightweight charm.
With Laravel 4, things seemed to be more straight forward.
Over Symfony, not a lot tbh (large parts of Laravel are built on Symfony), it's a lot more opinionated out the box than Symfony and Eloquent has a flatter learning curve than Doctrine.
There are 2 main packages of reusable components in php. Symfony and Zend.
Somewhat confusingly Zend and Symfony also make frameworks built on top of these components. But you can use the components on their own. Use the Composer to install the ones you need. You don't even need a framework to use them.
Laravel is built on top of Symfony components.
I think the main advantage to Laravel is people who use it really tend to like it... a lot. I hear a lot of complaining about other frameworks, but Laravel people enjoy. People that figure it out tend to get sites up really quickly. The main downside I hear about is performance.
For me documentation is key. I tried using Zend components, and while they worked I find the documentation really lacking. Zend have some great stuff like an api builder, but documentation is really important and its why I'll probably end up trying Laravel
Laravel has very reasonable and easy to understand structure and you don't need to use .xml or .yml for configuration.
I've had experience in CodeIgniter, Symfony, FuelPHP and I've been sticking with Laravel for over two years because of how simply nice it is to work with.
Artisan command line utility, Migrations for DB version control, Blade template engine and the neat directory structure are some of the things I like apart from the community ofcourse
http://laravel.com/docs/master/upgrade
http://mattstauffer.co/blog/upgrading-from-laravel-4-to-lara...
Yes. Completely. Not just "put it in a less prominent place" or "hide it six levels deep in the directory hierarchy" -- it was gone, overnight. Poof! Vanished.
I happened to be in the middle of a Laravel 3 project at the time, so the sudden removal of all documentation for the version I was working with was more than a little painful.
- Blade templating language. I don't need yet another templating syntax to learn, especially one that isn't analogous to others I know and are common among other frameworks.
- I really can't imagine going back to an active record based ORM. I've learned too many hard performance lessons from Doctrine1 and rails at this point.
- Facade/proxy pattern based classes. I think as they are implemented in the actual framework, these are done correctly. However, I think the userland understanding of this pattern is often lacking and leads to a lot of glorified singletons that are some how touted as acceptable because they call them facade/proxy based.
In the giant lineup of frameworks, ranging from something as simple as SlimPHP or silex, all the way to enterprise targeted frameworks like Zend Framework 2, I just don't see why I'd ever pick Laravel as the go-to solution in any use case.
- You don't have to use Blade. Use Twig or Smarty or whatever you want
- You don't have to use Eloquent. Use raw queries or Doctrine or whatever you want
- You don't have to use Facades - use the IOC container to get whatever you want
Its so easy to plug-and-play with composer, and there are so many other features to laravel.
All the major frameworks are just as decoupled, but as soon as you start selecting off the "native" defaults for things like templating and ORM you lose integration features that have been built into other areas of the framework to support that specific library.
thanks!
That said, while you can write beautiful code in PHP, IMHO, Laravel is not that.
It full of "string typing", over-applied and mis-applied Design Patterns, and poorly thought abstractions.
It just saddens me that Laravel is considered well designed and advanced codebase, or, worse, a standard of how PHP should be coded.
While it's not as bad as the Wordpress spaghetti, it is mostly Java EE (circa 2004) in PHP, sans the strong typing assurances (and, fortunately, sans the gobs of XML too).
On the other hand, Laravel works and has a strong community going for it, which, as in the case of Wordpress, makes all the difference in the world.
Are any of the other frameworks (Symfony2, Zend, etc..) better?
And eventually, when they've taken some of the original criticisms on-board (at v2.6) [0], they themselves get shot down by parts of the community for spoiling the architecture.
Yii is supposed to be nicer, I heard from colleagues, but I left PHP programming the moment I saw the opportunity so I can't vouch for that.
There's even less reason for a scripting language with a GIL to be saddled with this level of complexity, than there is for Java.
These days, I'd rather use the basic components (e.g. Symfony's HttpFoundation library) with something like league/container (formerly orno/di) and a simple routing library like nikic/FastRoute.
Oooh do enlighten. I made an argument when Symfony2 first came out that PHP isn't Java, and now I've been brainwashed to think the Symfony community is right.
Very refreshing to here an alternative point of view :)
I don't think there have been as many breaking changes in Rails vs Laravel, and Rails at v4 has been over ... 9-10 years? Laravel is < 6 years old, with, from what it seems to be, rather significant philosophical changes between major versions. Doesn't mean it's bad, but perhaps closer to using gentoo vs centos.