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 seed in laravel?
What are the site types supported by homestead?
What do you maen by method spoofing in laravel 5?
How to use multiple or condition in laravel query?
Explain how to do environment configuration in laravel?
Tell me does laravel support caching?
How to pass csrf token with ajax request?
Tell me how do you do dependency injection in laravel?
What is the best package to set up billing and subscription with stripe and braintree?
How to use the custom table in laravel model?
What is queues?
What is meant by Laravel - Encryption ?
How can you generate urls?
What is laravel service container?
How to use aggregate functions in laravel query?