cloudcreativity / laravel-json-api

JSON API (jsonapi.org) package for Laravel applications.
http://laravel-json-api.readthedocs.io/en/latest/
Apache License 2.0
778 stars 109 forks source link

missing middleware when register custom action #612

Closed eduardduta closed 3 years ago

eduardduta commented 3 years ago

My middleware is present on all default methods for resource but it's missing when i declare custom action.

Ex:

Route::name('api.')->middleware(TenantIdentifier::class)->group(function (Router $router) {
    JsonApiRoute::server('api')
        ->resources(function (ResourceRegistrar $server) {
            $server
                ->resource('resource name', PatientController::class)
                ->actions(function (ActionRegistrar $actions) {
                    $actions
                        ->withId()
                        ->get("image", 'image');
                })->middleware(TenantIdentifier::class);
        });
});
lindyhopchris commented 3 years ago

@eduardduta what package are you using? cloudcreativity/laravel-json-api or laravel-json-api/laravel?

eduardduta commented 3 years ago

I'm using laravel-json-api/laravel

lindyhopchris commented 3 years ago

Ok, this issue is in the wrong repository. I'll move it now.

lindyhopchris commented 3 years ago

Actually I can't move it to a different organisation. Please can you create the issue in the correct repository here: https://github.com/laravel-json-api/laravel

eduardduta commented 3 years ago

my bad, done, thank you