spiral/composer-publish-plugin
Composer plugin for Spiral apps that streamlines publishing package assets and configs into your project during install/update. Automates vendor asset deployment via Composer, reducing manual steps and keeping published files in sync.
Start by installing the plugin into your project via Composer:
composer require spiral/composer-publish-plugin
The plugin activates automatically once installed—no extra configuration required for basic usage. Its core value emerges when your own packages declare publishing instructions in their composer.json. Create a custom package (e.g., myorg/app-config) and include a extra.publish section specifying resource mappings:
{
"extra": {
"publish": {
"config/myapp.php": "config/myapp.php",
"assets/": "public/vendor/myapp/"
}
}
}
After requiring this package in a Laravel (or other Composer-based) app, run composer install—files are automatically copied to target locations.
extra.publish inside your package’s composer.json. Maps source paths (relative to package root) to destination paths (relative to application root).config/, migrations to database/migrations/, or stubs to resources/stubs/.composer install/update, files overwrite existing targets, ensuring consistency across environments (ideal for CI/CD). Avoid manual post-install scripts like php artisan vendor:publish.publish sections—files from each are merged safely (latter packages may overwrite former, but plugin logs conflicts).-vvv to Composer commands for verbose logs to debug missing files.config/myapp.v1.php) or using publish hooks for migrations.vendor:publish, this plugin doesn’t support tags or profile filtering. All declared resources always publish.Spiral\ComposerPublish\PluginEvents::POST_PUBLISH events via Composer plugins.How can I help you explore Laravel packages today?