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 is meant by Attaching Headers ?

1 Answers  


How to install and start, stop mysql on valet?

0 Answers  


What is service container?

0 Answers  


What is current stable version of laravel?

0 Answers  


What are the directory structure of laravel 5.8?

0 Answers  


Explain how to install installing mariadb on homestead?

0 Answers  


Name some inbuilt authentication controllers of laravel.

0 Answers  


What is a laravel model?

0 Answers  


What are route groups?

0 Answers  


Which template engine laravel use?

0 Answers  


What does valet park and link command do?

0 Answers  


What is the use of the bootstrap directory?

0 Answers  


Categories