From composer I Created a project from laravel/lumen. I un-commented the route middleware
$app->routeMiddleware([
'auth' => App\Http\Middleware\Authenticate::class,
]);`
and my routes added the auth middleware.
$app->get('/', ['middleware'=>'auth'], function () use ($app) {
return $app->version();
});
I get ErrorException in RoutesRequests.php line 656: Undefined variable: closure
I googled this and it seams to be a problem in 5.2 but I have 5.3 downloaded. Without the middleware I Get Lumen (5.3.3) (Laravel Components 5.3.*)
The closure should be the last item in your array. Change your route to:
$app->get('/', ['middleware'=>'auth', function () use ($app) {
return $app->version();
}]);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With