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
Write a code to upload a file in laravel 5?
What is the use of the eloquent cursor() method in laravel?
Explain me how to assign multiple middleware to laravel route ?
How to configure clear route cache in laravel?
How to use insert statement in laravel?
How to remove /public from url in laravel?
What is eloquent model?
How can we use middleware in laravel?
What is a recursive helper function?
Explain what are laravel facades?
What is eloquent orm?
What is database migration? And how to use it to add insert initial data to database?
How to generate urls from named named routes?
How will you explain middleware in laravel?
What do you know about php artisan?