Tag Archives: route

Laravel 5.0 – route annotation

This is are my discovers on the new routing system on Laravel 5.0.

Yah! I was trying, yesterday to use this new thing on Laravel.
Theres a huge discussion about in on Laracasts (https://laracasts.com/discuss/channels/general-discussion/route-annotation-in-laravel-5) … I’m not concerned about it… I just want it to work… how/why have they chosen this way its *their* problem.

Ok! yesterday I got a little mad with it.
I was following the book! and I wasn’t getting it to work.

This is how it works.

We need to add our controllers to app/Providers/RouteServiceProvider.php.

RouteServiceProvider Laravel 5.0

Add your new controller to the list.

On our controller

 /**
 * @Get("/tos/")
 */
 public function terms()
 {
     echo '<h1>Terms of Service!</h1>';
 }

 

After adding all your route annotations, you will need to update the “route:list” or what they call…

This is how…

php artisan clear-compiled
php artisan route:scan

and list them on console…

php artisan route:list

Your routes should work now.

 

 

 More readings

http://mattstauffer.co/blog/laravel-5.0-route-annotations
https://laracasts.com/discuss/channels/general-discussion/route-annotation-in-laravel-5
http://www.reddit.com/r/laravel/comments/2jex9b/introducing_route_annotations_in_laravel_50/

 

Can’t find routes.php in Laravel 5

f*ckzzzzz!
A video on Laracast says that routes.php is inside ./app/Http/.
Can’t find it.
sh*tttzzz!

I’m trying to figure it out and update this post! 🙂

Updates!

OK!, almost 24hours later…
But!, I hadn’t been all this time looking for the solution.

YES!, I’v seen it before and tried but didn’t worked…

I was trying to use Laravel Annotation, but with no success.

OK!, heres the real sh*t.

We can have routes.php on Laravel 5 inside app/Http.

We need to active it on app/Providers/RouteServiceProvider.php, by uncomment require app_path(‘Http/routes.php’);.

You will need to update the “route:list” or what they call…
This is how…

php artisan clear-compiled
php artisan route:scan

and list them on console…

php artisan route:list

Your routes should work now.

More readings

https://laracasts.com/discuss/channels/general-discussion/route-annotation-in-laravel-5
https://laracasts.com/discuss/channels/general-discussion/informal-poll-routes-file
https://laracasts.com/series/laravel-5-from-scratch/