captainhook/hook-installer
Composer plugin for CaptainHook that automatically installs and updates your local Git hooks after composer install/update, helping ensure your whole team has hooks enabled. Supports custom config/executable paths and optional force/only-enabled settings.
post-install, post-update), reducing friction for developers accustomed to Laravel’s dependency workflow.require-dev, ensuring it doesn’t bloat production builds.git commit --no-verify). Mitigate by:
git operations? Benchmark with critical paths (e.g., git commit).disable-plugin: true in composer.json)?npx).composer require --dev captainhook/captainhook
captainhook.json (e.g., linting, tests).hook-installer:
composer require --dev captainhook/hook-installer
composer.json includes:
"extra": {
"captainhook": {
"config": "captainhook.json",
"only-enabled": true
}
}
composer install/update triggers hook setup.git commit (check .git/hooks/).git commit or explicitly trigger them (e.g., GitHub Actions workflows).hook-installer.captainhook debug).composer update. Monitor CaptainHook releases for breaking changes.captainhook.json and run composer update to reinstall hooks.captainhook debug or check .git/hooks/ for errors. Log hook output to a file for visibility:
"extra": {
"captainhook": {
"log-file": "storage/logs/captainhook.log"
}
}
CONTRIBUTING.md section on hook requirements.composer install executed (check .git/hooks/).chmod +x .git/hooks/*).exec in composer.json if PHP isn’t in PATH.composer.json flag to disable hooks temporarily:
"extra": { "captainhook": { "disable-plugin": true } }
captainhook.json or use a shared config with exec pointing to a central binary.parallel option for independent hooks.git push).| Failure | Impact | Mitigation |
|---|---|---|
| Hooks block commits | Developer frustration | Educate on bypass risks; use only-enabled. |
| Hooks fail silently | Undetected issues reach production | Log hook output; enforce CI validation. |
| Composer plugin fails | Hooks not installed | Add composer validate to CI. |
| PHP version mismatch | Plugin/CaptainHook errors | Pin PHP version in composer.json. |
| Git client conflicts | Hooks ignored (e.g., GitHub Desktop) | Document CLI usage for reliability. |
captainhook list).How can I help you explore Laravel packages today?