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

How to use where null and where not null eloquent query in laravel?

0 Answers  


Explain collections in laravel.

0 Answers  


Name databases supported by laravel.

0 Answers  


Does laravel passport use jwt?

0 Answers  


What are laravel’s contracts?

0 Answers  






Explain validation concept in laravel.

0 Answers  


List some default packages provided by laravel 5.6?

0 Answers  


What is http middleware?

0 Answers  


How can someone change the default database type in laravel?

0 Answers  


How can we create a record in laravel using eloquent?

0 Answers  


What is trait in laravel?

0 Answers  


What is views in laravel?

0 Answers  


Categories