api-guard
api-guard copied to clipboard
METHOD NOT ALLOWED
Look like Api-Guard doesn't work with dingo/api 's route.
/** this route works **/ Route::get('protected/{id}', '\App\Http\Controllers\GetCouponController@forCustomer');
$api = app('Dingo\Api\Routing\Router');
$api->version('v1', function ($api) { /** this route give METHOD-NOT-ALLOWED **/ $api->get('get_coupon/customer/{id}', 'App\Http\Controllers\GetCouponController@forCustomer');
});
Hello, I got the same issue. Did you solve? Flavio
Passing the middleware along like this should work
$api->group(['prefix' => 'v1', 'middleware' => 'auth.apikey'], function ($api) {
Yes, you should be passing auth.apikey
in the middleware