slowprog/composer-copy-file
Composer script handler that copies files and directories after install/update. Configure mappings in composer.json (supports dev vs prod rules), nested directories, and overwrite control (override or only if older). Useful for publishing vendor assets like fonts/JS/CSS.
README.md, .env.example, or default database migrations) into projects without requiring custom scripts or post-installation steps.wp-config.php for WordPress plugins).Adopt if:
vendor/ to project root or a specific directory).post-install-cmd logic.Look elsewhere if:
{{APP_NAME}}). Consider alternatives like cweagans/composer-patches or custom scripts.post-install script or a deployment tool (e.g., Ansible).For Executives: "This package eliminates a common friction point in PHP development: manually copying files after installing a package. By automating the distribution of default configs, assets, or documentation during Composer install, we reduce onboarding time for developers and contributors by X%—freeing up engineering time for higher-impact work. The MIT license and minimal overhead make it a low-risk, high-reward addition to our toolchain, especially for projects like [Product X] where file templating is a recurring need."
For Engineering Teams:
*"composer-copy-file lets us replace ad-hoc post-install-cmd scripts with a single, declarative line in composer.json. For example:
"scripts": {
"post-install-cmd": [
"Slowprog\\ComposerCopyFile\\CopyFile::copyFile",
"vendor/package-name/templates/config.php => config/config.php"
]
}
This is perfect for:
README.md or .env.example to the project root.How can I help you explore Laravel packages today?