Search code examples
laravellaravel-5.5

Set default middleware in laravel


I am new in Laravel Framework. I want to set a middleware that will be called in all HTTP requests. How I set that middleware?


Solution

  • Use global middleware. From the docs:

    If you want a middleware to run during every HTTP request to your application, list the middleware class in the $middleware property of your app/Http/Kernel.php class.