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

Explain what is mvc architecture?

0 Answers  


How to add csrf protection in laravel?

1 Answers  


How to register a service provider in laravel?

0 Answers  


How to register a service provider via composer in laravel?

0 Answers  


What is the purpose of using dd() function iin laravel?

0 Answers  






What is a pull() ?

0 Answers  


What is a service supplier?

0 Answers  


What is use in laravel?

0 Answers  


Explain how to create custom middleware in laravel?

0 Answers  


What is bootstrap software development?

0 Answers  


What is service providers?

0 Answers  


What is route model binding in laravel?

0 Answers  


Categories