- How do I install this package in a Laravel project?
- Run `composer require marcocesarato/php-conventional-changelog` in your Laravel project directory. The tool is CLI-based, so no additional Laravel-specific setup is required beyond ensuring Git and PHP ≥7.1.3 are installed.
- Does this work with Laravel’s existing versioning (e.g., composer.json versions)?
- Yes, it fully supports SemVer and integrates with Laravel’s `composer.json` version fields. Use the `--ver` flag to specify a version or let it auto-detect from Git tags, which aligns with Laravel’s release workflows.
- Can I enforce Conventional Commits in Laravel before using this tool?
- Absolutely. Use Laravel’s `git-hooks` package or tools like Husky to validate commit messages before they’re pushed. Alternatively, migrate existing commits with tools like `commitizen` or enforce discipline via CI checks.
- How do I generate a changelog for a specific Laravel release in CI?
- Trigger the tool via Composer scripts in your CI pipeline (e.g., `composer changelog --from-tag v1.0.0 --to-tag v2.0.0`). For GitHub Actions, add a step like `php vendor/bin/changelog --output CHANGELOG.md` after merging release branches.
- Will this break if my Laravel project uses squashed merges or rebased history?
- It may require adjustments. Use the `--history` flag or specify `--from-tag/--to-tag` ranges to isolate clean commit ranges. Test with a representative Git history to ensure accuracy, especially for projects with complex merge strategies.
- Can I customize the changelog template for Laravel-specific needs?
- Yes, create a `.changelog` config file in your Laravel project root or use CLI flags like `--template` to override defaults. For team consistency, store templates in `config/changelog.php` and load them dynamically via Laravel’s config system.
- Does this integrate with Laravel Forge/Envoyer for deployments?
- Indirectly. Use Forge/Envoyer’s script hooks to run `composer changelog` before releases. For Envoyer, add a pre-deploy script to generate the changelog and attach it as a release artifact. Forge supports this via deployment scripts.
- What if my Laravel project has monorepo or submodule dependencies?
- Limited support exists. For submodules, use `--root` to target the main repo or adjust paths with `--path`. Monorepos may require manual filtering; test with `--dry-run` first to validate output before full adoption.
- How do I handle GPG-signed Git tags for Laravel releases?
- GPG signing is optional. Use `--sign-tag` if your workflow requires it, but default to `--annotate-tag` for simplicity. Document GPG setup in your team’s release guide, as Laravel projects often rely on GitHub/GitLab’s automated signing.
- Are there alternatives for Laravel changelogs that might be simpler?
- For lighter needs, consider `php artisan release:notes` (if using Laravel’s built-in tools) or `keepachangelog.com`-style manual templates. For automation, this package is more robust than tools like `git-log` scripts but requires Conventional Commits discipline.