createPage->handle($user, $data); * * // Via static helper * $page = CreatePage::run($user, $data); * * // Via app container * $page = app(CreatePage::class)->handle($user, $data); * * Directory structure: * app/Mod/{Module}/Actions/ * ├── CreateThing.php * ├── UpdateThing.php * ├── DeleteThing.php * └── Thing/ * ├── PublishThing.php * └── ArchiveThing.php */ trait Action { /** * Run the action via the container. * * Resolves the action from the container (with dependencies) * and calls handle() with the provided arguments. */ public static function run(mixed ...$args): mixed { return app(static::class)->handle(...$args); } }