in Technology by
What is Laravel’s Middleware?

1 Answer

0 votes
by

As the name suggests, Middleware acts as a middleman between request and response. It is a type of filtering mechanism. For example, Laravel includes a middleware that verifies whether the user of the application is authenticated or not. If the user is authenticated, he will be redirected to the home page otherwise, he will be redirected to the login page.

There are two types of Middleware in Laravel.
Global Middleware: will run on every HTTP request of the application.
Route Middleware: will be assigned to a specific route.

Related questions

0 votes
    What are Laravel’s service container ?...
asked Sep 30, 2021 in Technology by JackTerrance
0 votes
    Where will we define Laravel’s Facades?...
asked Sep 28, 2021 in Technology by JackTerrance
0 votes
0 votes
    What’s the use of Middleware in Django?...
asked Jul 1, 2021 in Technology by JackTerrance
0 votes
    What is .NET Core middleware?...
asked Jun 13, 2023 in Technology by JackTerrance
...