What is meant by Controller Middleware ?



What is meant by Controller Middleware ?..

Answer / 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

More Laravel PHP Framework Interview Questions

What permissions are required to be on storage and the bootstrap/cache directories to run laravel?

0 Answers  


Please explain events in laravel?

0 Answers  


How to install valet?

0 Answers  


What is guarded attribute in a model?

0 Answers  


Explain how to register a service provider via composer in laravel?

0 Answers  


Explain what is valet?

0 Answers  


How can you retrieve values for laravel configration files.

0 Answers  


Tell me how can you display html with blade in laravel?

0 Answers  


What is laravel auth guard?

0 Answers  


What is name of first file that loaded in laravel?

0 Answers  


How to register a middlewares in laravel controller?

0 Answers  


How does antiforgerytoken work?

0 Answers  


Categories