composer/installers
Custom installer paths for Composer. Maps package types (e.g., WordPress plugins/themes, Drupal, Joomla) to appropriate directories so dependencies land where your CMS expects them, with flexible installer definitions for multi-project setups.
public, config, routes) during dependency installation. This aligns well with Laravel’s convention-over-configuration philosophy but may introduce indirect coupling if overused in non-Laravel projects.composer.json hooks (e.g., post-install-cmd, post-update-cmd) to automate asset linking, which reduces manual php artisan commands in CI/CD pipelines. However, this assumes Laravel’s directory structure (public/, config/, etc.), limiting flexibility in monorepos or multi-framework setups.composer.json configuration.installers-definitions).vendor/bin/installers:install --paths=app/Resources). This is useful for non-standard setups but adds complexity.post-install-cmd scripts (e.g., Laravel Forge, Envoyer, or custom scripts). Mitigation requires sequencing control (e.g., ordering hooks in composer.json).| Risk Area | Severity | Mitigation Strategy |
|---|---|---|
| Broken Asset Links | High | Test in CI with composer install --no-dev. |
| Hook Ordering | Medium | Explicitly define hook order in composer.json. |
| Non-Laravel Projects | Low | Use installers-definitions for custom paths. |
| Composer Version | Low | Package supports Composer 1.10+ (LTS). |
public/, config/)? If so, how will installers-definitions be configured?php artisan commands in pipelines? (e.g., optimize, config:cache).public/staging/)? If so, how will they be handled?--profile.)installers-definitions (e.g., Symfony, custom frameworks).composer.json for existing post-install-cmd scripts.installers-definitions).require-dev (or require) in composer.json:
"extra": {
"installer-paths": {
"public/{$name}": ["type:asset"],
"config/{$name}": ["type:config"]
}
}
composer install --no-dev to validate asset links.php artisan commands (e.g., link-storage) with Composer’s automated linking.php artisan storage:link if installers handles public/storage.composer/installers v1.x).installers-definitions, but requires manual configuration.composer.json to avoid conflicts:
"scripts": {
"post-install-cmd": [
"Illuminate\\Foundation\\ComposerScripts::postInstall",
"@php artisan optimize"
],
"post-update-cmd": [
"Illuminate\\Foundation\\ComposerScripts::postUpdate",
"@php artisan optimize"
]
}
installers before Laravel’s default hooks to ensure assets are linked early.installers package (MIT license = low risk, but check changelog).installers-definitions in composer.json for future maintainers.composer.json for misconfigured paths or hook conflicts.composer install --verbose to trace installer execution.public/ is not writable. Mitigate with:
composer install --no-scripts && composer install
installer-paths in composer.json matches actual file locations.composer install --ignore-platform-reqs --no-scripts
installers-definitions in a shared composer.json template for consistency.| Failure Scenario | Impact | Recovery Strategy |
|---|---|---|
| Broken Asset Links | App fails to load (404s) | Rollback Composer version; manual ln -s. |
| Hook Conflict | Silent asset linking failure | Reorder hooks in composer.json. |
| Composer Version Incompatibility | Install fails | Pin composer/installers to a stable version. |
| Custom Path Misconfiguration | Wrong files linked | Audit installer-paths in composer.json. |
artisan link needed).storage:link from pipelines).installer-paths syntax.CONTRIBUTING.md:
## Asset Linking
This project uses `composer/installers` to automate asset linking. Custom paths are defined in `composer.json` under `extra/installer-paths`.
How can I help you explore Laravel packages today?