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 get data between two dates with query in laravel?

395


How to turn off crsf protection for specific route in laravel?

385


State the difference between codeigniter and laravel.

415


What is blade template?

376


What is the use of route in laravel?

398






how to create subdomain routing in laravel 5?

434


How to change your default database type in laravel?

409


What is meant by url in internet?

408


What is the significant difference between insert() and insertgetid() function in laravel?

692


Explain how to add csrf protection in laravel?

433


How do I seed my database for column that is a foreign key referencing to other table?

390


What is a service provider laravel?

426


What are the directory structure of laravel 5.8?

407


How to check column is exists or not in a table using laravel?

405


Explain how to serve sites on valet?

407