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
What is artisan in laravel?
What are the example of services?
What is the use of Laravel - Sending Email ?
How will you explain middleware in laravel?
How to get JSON Response on Laravel ?
How to use aggregate functions in laravel query?
What is x-xsrf-token?
How can someone change the default database type in laravel?
What are the Versions Laravel - Understanding Release Process ?
In which directory controllers are kept in laravel?
How to install laravel via composer?
How to generate a controller with resources in laravel?
How to write html code in laravel controller?
Define homebrew?
What is validation in laravel and how it is used?