api-guard icon indicating copy to clipboard operation
api-guard copied to clipboard

METHOD NOT ALLOWED

Open hqtrung opened this issue 8 years ago • 3 comments

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');

});

hqtrung avatar Sep 16 '16 02:09 hqtrung

Hello, I got the same issue. Did you solve? Flavio

flaviosuardi avatar Mar 07 '17 10:03 flaviosuardi

Passing the middleware along like this should work $api->group(['prefix' => 'v1', 'middleware' => 'auth.apikey'], function ($api) {

laemol avatar Nov 26 '17 10:11 laemol

Yes, you should be passing auth.apikey in the middleware

chrisbjr avatar Nov 29 '17 13:11 chrisbjr