Support the ongoing development of Laravel.io →
Requests
Last updated 1 year ago.
0

Consider you have the method getProfile in your UserController, then your route is like this:

Route::controller(['user' => 'App\Http\Controllers\UserController'])

It will generate for you the user/profile uri with a get http verb.

http://laravel.com/docs/5.0/controllers#implicit-controllers

0

@micaweb

To clarify, the Route::controllers (plural!) method essentially allows to list a bunch of Route::controller (singular) methods. That is not mentioned in the official doc...

@trololosha4real

While developing it might be useful to use the console and check the routes. Open your console, go to the root of your Laravel project and type

php artisan route:list

in Laravel 4 it is

php artisan route

In this table you can also see whether a route has a name or not and a lot of other useful information.

0

micaweb said:

Consider you have the method getProfile in your UserController, then your route is like this:

Route::controller(['user' => 'App\Http\Controllers\UserController'])

It will generate for you the user/profile uri with a get http verb.

What will be the html link for that getProfile method? I have tried in this way but it won't work. it throws route not defined exception.

<a href="{{ route('user.getProfile',$user->id) }}" > >~~~ What is wrong with this?
Last updated 7 years ago.
0

php artisan route:list and look at your routes.

0

Here is the add-back code, easy implementation:

https://github.com/shrimpwagon/laravel-route-controller

Last updated 6 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.