What is Laravel - Middleware ?

Answer Posted / 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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How to get Retrieving the Request URI ?

784


What version of laravel do you generally use?

407


What is database migration. How to create migration via artisan?

395


How to get requested path in laravel?

440


Explain me active record implementation. How to use it laravel?

395






What do you understand by orm?

424


How can we get the user's ip address in laravel?

419


What is meant by Forms in Laravel ?

1064


Tell me when laravel was launched?

427


Provide system requirements for installation of laravel framework?

429


What are the databases laravel supports?

448


What is database migration in laravel? How to use this?

392


Explain how to resolve class instance out of the container in laravel?

364


What are the site types supported by homestead?

430


How to Accessing Session Data in Laravel ?

800