what is meant by Global Middleware and Route Middleware ?



what is meant by Global Middleware and Route Middleware ?..

Answer / 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

More Laravel PHP Framework Interview Questions

What is compact in laravel?

0 Answers  


Is it easy to learn laravel?

0 Answers  


What is a flush() ?

0 Answers  


Tell me what is service providers?

0 Answers  


Does laravel support php 7?

0 Answers  


How do I make a middleware to be run during every http request to an application?

0 Answers  


How to Assigning Middleware to Route ?

0 Answers  


What is middleware in laravel?

0 Answers  


What is redirect routes?

0 Answers  


What is the command to connect vagrant via ssh?

0 Answers  


How to generate it on homestead?

0 Answers  


List out the databases laravel supports?

0 Answers  


Categories