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
How to get data between two dates with query in laravel?
How to turn off crsf protection for specific route in laravel?
State the difference between codeigniter and laravel.
What is blade template?
What is the use of route in laravel?
how to create subdomain routing in laravel 5?
How to change your default database type in laravel?
What is meant by url in internet?
What is the significant difference between insert() and insertgetid() function in laravel?
Explain how to add csrf protection in laravel?
How do I seed my database for column that is a foreign key referencing to other table?
What is a service provider laravel?
What are the directory structure of laravel 5.8?
How to check column is exists or not in a table using laravel?
Explain how to serve sites on valet?