Looking to hire Laravel developers? Try LaraJobs
This package is not available.

single-action-resource-controllers-for-laravel-dingo-api maintained by clean-bandits

Author
Clean Bandits
Last update
2024/03/08 10:43 (dev-main)
License
Downloads
110

Comments
comments powered by Disqus

Single Actions Resource Controllers for Laravel Dingo API

This package extends Dingo API with new feature - Route::resource combined with "Single Action Controllers".

How does it work?

It's really simple,

  • Just add new route like this $api->singleActionResource('payments-by-link', ['uses' => 'PaymentByLink']);
  • Create new single action (invokable) controllers for each action you need, like this. img.png
  • Each controller should have public function __invoke

Installation

composer require clean-bandits/single-action-resource-controllers-for-laravel-dingo-api
In DingoServiceProvider add this code

 public function register(): void
    {
        $this->app->extend('api.router', function (\Dingo\Api\Routing\Router $router) {
            return new \CleanBandits\SingleActionResourceControllersForLaravelDingoApi\Router($router);
        });
        parent::register();
    }