@JeffreyWay you will have to refresh a lot of L5 casts. As a beginner, who started learning laravel with laravel 5, it is better to have these major changes implemented before best practices become habits.
@SNaRe I think its best if you got started at Laravel 4, trying to jump to L5 while its still alpha might force you to relearn a lot of things since its still changing almost everyday.
@zinyando you would be right if Laravel was my 1st framework. But I have been working with frameworks for a long time. On the other hand, when you jump and witness the development of the framework in alpha phase, you become an advanced user of the framework and not even noticing it.
Keep it!
- routes.php is more readable then php artisan route:list / routes.scanned.php when using Route::group
- regarding less typing: using Route::group, you can declare middleware for multiple controllers without having to annotate the middleware in every single controller all the time
- regarding less file switching: well, according to the last commit it's required to define a controller to be scanned manually.
- others have already mentioned the problems regarding "annotations" really being comments/DocBlocks
@yannik - Then don't use annotations.
@JefferyWay It involves a few steps to setup elixir and its dependancies and run gulp watch in order for routes to get grabbed from annotations. Therefore I believe the default way should be having the routes.php file and there have a nice comment block expanding how route annotations can automate the generation of the routes file! A possible link to laracasts video talking about it is not bad idea at all!! :)
@JeffreyWay Naturally, I am not going to use annotations. Yes, I have experimented with them. However, as most people in this thread have stated, please keep routes.php as default to make life easier for new developers coming to laravel.
@yannik i don't think many people will ever read that generated file so its fine for it to be messy :)
after watching how annotations work i think i will definitely use them! i only wish there was a way for laravel to automatically fire up "gulp watch" if its not running and am on a development environment! will look it up thought! it should be possible!
It involves a few steps to setup elixir and its dependancies and run gulp watch in order for routes to get grabbed from annotations.
In the local environment, routes are automatically scanned now. So that's a non-issue.
i don't think many people will ever read that generated file so its fine for it to be messy :)
The routes.scanned.php file has been cleaned up. It looks nice now.
The "newcomer"-argument is really not an argument at all. When you were new, you didn't know how routes worked in Laravel. So wether you have to learn the annotations-way, or the routes.php way, doesn't matter.
Like I said earlier, I liked the overview routes.php gave in one place. But then again, a simple route:list command servers the same purpose, and arguably even better.
There are so many drawbacks of "route annotations", which have all been discussed in this thread. So, why have newcomers learn the harder and arguably worse way?
@yannik, what's the problem? If you don't like it - just don't use it. Create routes.php and go ahead. Taylor already gave an example on how to use them. I don't see any problems with annotations, it's even more convenient for me.
@yannik I agree annotations should stay totally optional and not become the "recomanded" way of routing, which seems to become the case.
Firstly, the last three of you cowboys need to associate a photo with Gravatar.com. Come on, dudes. :)
Annotations are the recommended way in Laravel 5. Sucks if you don't like it, but Taylor has made it as simple as humanly possible to revert back to the other way. There's absolutely nothing to complain about here.
@JeffreyWay ok im done.
You know I will quietly cry a litte inside each time i'll see a @ in your screencasts :'(
@pmall, hope you'll get used to annotations :D
Well, I would prefer progressive enhancement, but it's an easy change to make.
On the flip side, there's the opportunity for someone to make a plugin that does auto-complete and syntax highlighting for IDEs ;) (Preferably Sublime Text!)
My final thought... I'm much happier being part of such lively discussions than I would ever be using another PHP framework.
*1 Yes keep it please with an example. Remember your roots about making it easy for everyone and for advance developer can always quickly remove it.
@miguelgarcia7 Have you watched this updated Annotations video? It takes like 5 seconds to create routes.php and uncomment one line if you wish to have it L4 way.
@HRcc Thanks.
Out with the old, in with the new. Burn it.
+1 for including routes.php by default.
Keep routes.php and its location obvious. I'm all for KISS if it doesn't break anything or encourage bad practice. More experienced devs can customise and change things as they see fit, taking advantage of new techniques as determined by the scale and complexity of each project. But new learners want something simple that they can get going with right away.
It was removed already.
And it's been changed back to included, again.
This was an interesting\confusing post to come across 8 months later... Glad routes.php won out
+1 to include by default.
+1 for keeping it and include by default
Yes to 'include by default'.
It would be very helpful for big projects and would improve structure. I am for creating my own route file
Please or to participate in this conversation.