what is meant by Global Middleware and Route Middleware ?

Answer Posted / rishabh khanna

The Global Middleware will run on every HTTP request of the application, whereas the Route Middleware will be assigned to a specific route.
The middleware can be registered at app/Http/Kernel.php.
This file contains two properties $middleware and $routeMiddleware.
Middleware property is used to register Global Middleware.
To register the global middleware, list the class at the end of $middleware property.
RouteMiddleware property is used to register route specific middleware.
To register the route specific middleware, add the key and value to $routeMiddleware property.

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 an observer?

546


Do you know what is laravel elixir?

537


What is view routes?

433


What is meant by Laravel - Validation ?

1025


What is dd() function in laravel?

621






Tell us what are bundles, reverse routing and the ioc container?

513


What is a Artisan command ?

718


Tell me how do you do dependency injection in laravel?

465


How to configure cron jobs in homestead?

494


What is meant by Retrieving Input ?

1036


How to make a custom validation rule in laravel?

515


How to configure route cache and clear route cache in laravel?

527


When laravel was launched?

563


What is meant by Attaching Headers ?

1174


What is database migration used in laravel 5? Explain

481