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 |
What is bootstrap software development?
What do you mean by boot & register method used in laravel 5?
Explain how to upgrade valet to valet 2.0?
How to start and stop valet?
How can we use maintenance mode in laravel 5?
What do you know about php artisan? Mention some artisan command.
Why are migrations important?
In laravel, what is guarded attribute in a model?
What is a Composer command ?
What is the use of the eloquent cursor() method in laravel?
Tell me how would you add a 3rd party package like sentry?
What is namespace laravel?