What is Laravel - Middleware ?



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

Post New Answer

More Laravel PHP Framework Interview Questions

explain how to add a middleware in route group?

0 Answers  


What are deferred providers in laravel?

0 Answers  


Explain me what is your favorite feature of laravel?

0 Answers  


What are middlewares in laravel?

0 Answers  


What is register method?

0 Answers  






How to Connecting to Database in Laravel ?

1 Answers  


Explain the difference between implicit and explicit route binding in laravel?

0 Answers  


What is the difference between facades vs helper functions?

0 Answers  


How to do dependency injection in laravel controllers?

0 Answers  


What is laravel 5 homestead?

0 Answers  


What is controller in laravel?

0 Answers  


How to Configuration Laravel - Encryption ?

1 Answers  


Categories