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 |
What permissions are required to be on storage and the bootstrap/cache directories to run laravel?
Please explain events in laravel?
How to install valet?
What is guarded attribute in a model?
Explain how to register a service provider via composer in laravel?
Explain what is valet?
How can you retrieve values for laravel configration files.
Tell me how can you display html with blade in laravel?
What is laravel auth guard?
What is name of first file that loaded in laravel?
How to register a middlewares in laravel controller?
How does antiforgerytoken work?