1
I created a Middleware
which is working perfectly, but it is running on routes that I have declared in the route group and is also running on other routes that I have not declared.
Example:
Route 1:
$router->post('/xpto', 'Controller@xpto');
Route 2:
$router->group(['middleware' => 'meuMiddleware'], function () use ($router) {
$router->post('/xpto2', 'Controller@xpto2');
});
Both routes of the example are calling the Middleware
.
Where is the first route set? How did you prove that the middleware is running on it?
– Woss
Put your App Kernel.php here. If you have placed the class of this Middleware in the array
$middleware
, it will run on all routes.– CypherPotato
Perfect, I changed the Middleware record and it worked. Thank you
– Wellington Rogati