Parameter | Header |
---|---|
Router $router | \Illuminate\Routing\Router $router |
Middleware means that every call to a route will go through the middleware before actually hitting your route specific code. In Laravel the web middleware is used to ensure session handling or the csrf token check for example.
There are other middlewares like auth or api by default. You can also easily create your own middleware.