Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Composer Copy File Laravel Package

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.

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • Feature Development: Accelerates implementation of file-based workflows (e.g., copying config templates, assets, or boilerplate files) during package installation, reducing manual setup steps for developers.
  • Developer Experience (DX): Enables seamless integration of static assets (e.g., README.md, .env.example, or default database migrations) into projects without requiring custom scripts or post-installation steps.
  • Build vs. Buy: Justifies buying this lightweight solution over building a custom Composer script, especially for teams prioritizing maintainability and avoiding reinventing the wheel.
  • Roadmap Prioritization: Ideal for projects where file templating or asset distribution is a recurring need (e.g., SaaS starters, CLI tools, or modular PHP libraries).
  • Use Cases:
    • Automating the distribution of default configurations (e.g., wp-config.php for WordPress plugins).
    • Bundling license files, documentation, or third-party dependencies with a package.
    • Simplifying onboarding for open-source projects by pre-populating critical files.

When to Consider This Package

  • Adopt if:

    • Your project requires reproducible file deployment during Composer installation (e.g., copying files from vendor/ to project root or a specific directory).
    • You’re maintaining a library, plugin, or CLI tool where users expect default files to be auto-generated.
    • Your team lacks bandwidth to maintain custom Composer scripts or post-install-cmd logic.
    • You need a lightweight, dependency-free solution (no external services or complex setup).
  • Look elsewhere if:

    • You require dynamic file generation (e.g., templating with placeholders like {{APP_NAME}}). Consider alternatives like cweagans/composer-patches or custom scripts.
    • Your use case involves large file sets or complex permissions (e.g., chmod/chown), which may need a more robust tool like a custom post-install script or a deployment tool (e.g., Ansible).
    • You’re working in a monorepo or need cross-package file synchronization (e.g., copying files between multiple installed packages).
    • The package’s last release (2020) is a concern for long-term maintenance. Evaluate whether the risk of stale dependencies aligns with your project’s needs.

How to Pitch It (Stakeholders)

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:

  • Plugins/Libraries: Auto-deploying README.md or .env.example to the project root.
  • CLI Tools: Bundling default command templates.
  • Legacy Codebases: Cleaning up manual file-copy steps in CI/CD. The package is tiny (~1KB), actively used (48 stars), and avoids reinventing the wheel. Let’s prototype it for [Use Case Y] and measure the DX improvement."*
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
besmartand-pro/php-quality-config
sentix/ai-chatbot
codifyo/ts-generator-bundle
mintobit/jobqueue
a4sex/maintenance-bundle
a4sex/entity-date-update
a4sex/client-identifier
a4sex/base-utilites
a4sex/key-value-storage
a4sex/micro-status
chilldev/dependency-injection-extra
datinglibre/datinglibre-app-api
biberltd/corebundle
bricre/symfony-bundle-test
biberltd/logbundle
dominium/http-adapter-bundle
dominium/google-analytics
a4sex/auto-clean-entity
christhompsontldr/laravel-inky
spatie/mailcoach-vapor