Answer Posted / amit khanna
Middleware can also be assigned to controller’s route or within your controller’s constructor and it can be used with controller also..
You can use the middleware method to assign middleware to the controller.
The registered middleware can also be restricted to certain method of the controller.
Assigning Middleware to Route
Route::get('profile', [
'middleware' => 'auth',
'uses' => 'UserController@showProfile'
]);
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
What is route group in laravel?
What is facade in laravel?
What do you mean by bundles?
What is route in laravel?
Explain how to install installing mariadb on homestead?
Explain active record concept in laravel.
What is csrf_field () in laravel?
Tell us do you have any experience with lamp?
Explain about Form without CSRF token in Laravel ?
Tell me when laravel was launched?
List out common artisan commands used in laravel.
What is laravel policy?
What is a Restful Resource Controllers ?
Is laravel secure?
What is laravel orm?