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

Popular posts from this blog

aws api gateway - SerializationException in posting new Records via Dynamodb Proxy Service in API -

asp.net - Problems sending emails from forum -