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
When laravel was launched?
List the requirements to install valet?
What is raw expression in laravel?
What is meant by Retrieving Input ?
How to install installing mariadb on homestead?
What do you know about php artisan? Mention some artisan command.
How to get current url in laravel?
What do you understand by database migrations in laravel? How can we use it?
What are named routes in laravel?
Explain closures in laravel?
Explain laravel’s middleware?
What are the 3 service provider types?
Define hashing in laravel.
Explain the difference between laravel and codeigniter?
How will you describe bundles in laravel?