What is Laravel - Middleware ?
Answer / sunil kumar
Middleware acts as a bridge between a request and a response. It is a type of filtering mechanism.
Laravel includes a middleware that verifies whether the user of the application is authenticated or not.
If the user is authenticated, it redirects to the home page otherwise, if not, it redirects to the login page.
It can be create by executing the following command - php artisan make:middleware <middleware-name>.
Replace the <middleware-name> with the name of your middleware. The middleware that you create can be seen at app/Http/Middleware directory.
| Is This Answer Correct ? | 0 Yes | 0 No |
How to use skip() and take() in laravel query?
What are the requirements for laravel 5.8?
Why use route?
What is pluck method in laravel?
How do I set up the eloquent relationships between the aforementioned comments and authors, including creating the schema design?
What are class traits?
What service provider’s register method does?
How do I see all of the routes that are defined?
Please explain events in laravel?
How to create Facade in Laravel ?
Is multiple php versions are supported by homestead?
What is compact in laravel?