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 x-xsrf-token?
Explain traits in laravel.
Tell us what are advantages of laravel?
What is reverse routing in laravel?
How to assign a variable value for all view file?
What are the software’s included in laravel homestead?
What do you mean by laravel mix?
How does antiforgerytoken work?
In order to run laravel. What permissions are required to be on storage and the bootstrap/cache directories?
Explain to listeners.
What are macros in laravel?
Does laravel support php 7?