lorisleiva / laravel-actions

⚡️ Laravel components that take care of one specific task
https://laravelactions.com
MIT License
2.41k stars 117 forks source link

feat: allow custom design patterns #248

Closed jaulz closed 1 year ago

jaulz commented 1 year ago

This PR allows custom patterns to be registered via:

    $this->app->extend(ActionManager::class, function (ActionManager $actionManager) {
      $actionManager->registerDesignPattern(new FooBarDesignPattern());

      return $actionManager;
    });
lorisleiva commented 1 year ago

Thanks! FYI, you can also use the Facade to update the Action Manager like so.

use Lorisleiva\Actions\Facades\Actions;

Actions::registerDesignPattern(new FooBarDesignPattern());
jaulz commented 1 year ago

Ah, thanks for the merges and the hint 😊