lunarstorm / laravel-ddd

Toolkit for domain driven design (DDD) in Laravel. Provides artisan commands to generate domain models, DTOs, view models, value objects, and much more.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Support for Actions

JasperTey opened this issue · comments

I found myself wanting to generate domain Actions enough times that I think it's finally time to implement a corresponding ddd:action generator.

commented

image

commented

I assume that will make lorisleiva/laravel-actions a dependency for the package now? (I am A-OK with this)

I assume that will make lorisleiva/laravel-actions a dependency for the package now? (I am A-OK with this)

I'm thinking not necessarily a formal dependency, but the default stub will generate an opinionated laravel-actions action class that assumes you have lorisleiva/laravel-actions installed. Similar to how ddd:dto generates a dto extending Spatie\LaravelData\Data without Spatie\LaravelData being a formal dependency.

Other considerations:

  • Introduce a ddd.base_action config (alongside base_model, base_dto, base_view_model)
  • Since laravel-actions actions are trait-driven and don't extend a base class, ddd.base_action can be null by default
  • Those who want actions to extend something else can configure accordingly and publish and customize the stub.