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

What is bootstrap software development?

547


How to stop valet?

540


Explain php artisan?

531


What is meant by check method ?

1282


Explain how to list all routes in laravel?

607


What is the role of service provider?

517


How to generate urls from named named routes?

534


How will you explain events in laravel?

546


How to use multiple or condition in laravel query?

524


Tell me what are the official packages provided by laravel?

548


How to Create Creating a Cookie in Laravel ?

1051


Name some inbuilt authentication controllers of laravel.

553


How to register a middleware in laravel 5?

582


What is a Encryption Process ?

847


What is laravel slug?

578