php - Laravel api guard - Does not save log or authenticates when second route parameter is a function -
i using api guard laravel (https://github.com/chrisbjr/api-guard) works when route example below
route::get('api/v1/books/{id}', 'bookscontroller@show');
if need use route that
route::get('api/v1/books/{id}', function(){ app::make('app\http\controllers\book\bookcontroller')->getindex(); });
the api guard don´t save log or authenticates.
someone can me?
this library works when calling controller because, per instructions, controller extends apiguardcontroller
controller, , closure not.
luckily, implemented route middleware, can this:
route::get('api/v1/books/{id}', function() { app::make('app\http\controllers\book\bookcontroller')->getindex(); })->middleware('apiguard');
Comments
Post a Comment