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 seeding in laravel?
What is a Terminable Middleware ?
How to rollback last migration?
What is ssrf attack?
What is a recursive helper function?
How to use update statement in laravel?
What are the site types supported by homestead?
What is valet?
What do you mean by route groups used in laravel 5?
How to Declaration of namespace ?
What is open source software?
Explain about laravel project?
How to install laravel via composer?
What is csrf protection?
How to extend a layout file in laravel view?