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

How to configure route cache in laravel?

619


What are the Advantages of Laravel ?

646


What are route parameters?

548


How to register a service provider in laravel?

515


Is laravel better than wordpress?

570


What is auth :: routes ();?

512


What is the boot method?

592


Where do you regiser service providers?

528


What is Basic Response in Laravel ?

1052


What is a Encryption Process ?

831


What is Testability ?

655


Explain laravel’s service container?

536


How to use basic routing in laravel?

534


What are the difference between latest() and oldest() in laravel?

566


Explain extending bindings?

581