dreimus/package-actions
Laravel package for structuring reusable “actions” as self-contained classes. Helps keep controllers thin by moving business logic into invokable action objects, with clear inputs/outputs and simple execution patterns for consistent app workflows.
composer.json. This reduces boilerplate and centralizes logic in the package itself.public directory.post-install-cmd, post-update-cmd) map directly to Composer’s lifecycle events.bootstrap/app.php or composer.json scripts could trigger additional logic after the plugin’s actions, enabling hybrid workflows (e.g., plugin handles file setup, Laravel handles service registration).optimize, dump-autoload).composer.json scripts, as they’re executed in Composer’s context rather than Laravel’s.laravel/package-tools) that solve similar problems more robustly?local environments or for specific packages)?composer install/update.composer.json scripts: More verbose but offers explicit control.post-install-cmd script with the plugin’s equivalent action.composer.json script as a backup for critical packages until the plugin’s reliability is proven.vendor/bin vs. vendor).storage/ or bootstrap/cache/).cweagans/composer-patches).pre-install-cmd for actions like dependency checks or environment validation.post-install-cmd/post-update-cmd for:
.env templates, config files).public/vendor/).booted() event or register() in service providers for runtime setup.post-remove-cmd) to revert changes if a package is uninstalled.README or CONTRIBUTING.md.// In a custom Composer plugin or Laravel service provider:
\Log::info('PackageActions', ['action' => 'post-install', 'package' => 'vendor/package']);
composer remove).composer --verbose install).composer.json as a fallback.composer install in large projects. Benchmark impact.booted() for deferred tasks.storage/, bootstrap/cache/) in environments with restricted write access.| Failure Scenario | Impact | Mitigation |
|---|---|---|
| Plugin crashes during install | Broken deployment | Fallback to composer.json scripts. |
| File permission denied | Silent failures | Use umask or Laravel’s storage symlink. |
| Package dependency conflicts | Install failures | Audit plugin dependencies in composer.json. |
| Plugin abandoned | Unmaintained actions | Fork or replicate logic in-house. |
| Laravel-specific path resolution | Missing files | Use Laravel’s base_path() in custom actions. |
php artisan commands post-install).How can I help you explore Laravel packages today?