What is meant by Controller Middleware ?

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


Please Help Members By Posting Answers For Below Questions

What is seed in laravel?

478


What are the site types supported by homestead?

430


What do you maen by method spoofing in laravel 5?

415


How to use multiple or condition in laravel query?

406


Explain how to do environment configuration in laravel?

418






Tell me does laravel support caching?

414


How to pass csrf token with ajax request?

441


Tell me how do you do dependency injection in laravel?

385


What is the best package to set up billing and subscription with stripe and braintree?

402


How to use the custom table in laravel model?

417


What is queues?

437


What is meant by Laravel - Encryption ?

933


How can you generate urls?

495


What is laravel service container?

425


How to use aggregate functions in laravel query?

416