sohelamin / lumen-route-list

Lumen Route List
https://packagist.org/packages/appzcoder/lumen-routes-list
117 stars 31 forks source link

Middleware not displayed if used in controller instead of web.php #8

Closed LLuisJ closed 4 years ago

LLuisJ commented 5 years ago

Lumen Version:

"name": "laravel/lumen-framework",
"version": "v5.7.7"

When I use my middleware in the controller directly it doesn't show up in the list.

So when I use it like this in my controller class:

public function __construct() {
     $this->middleware('login', ['only' => [
         'createLogin'
     ]]);
}

instead of this in the web.php:

$router->get('/test', ['middleware' => 'test', function () {
    return response()->json('Foo');
}]);

the middleware isn't listed when I run php artisan route:list