Package Compatibility
Primary Goal
Keep package code, dependencies, and workflows compatible with the supported Laravel 13 and PHP 8.3+ matrix.
Workflow
- Read
composer.jsonfirst to determine PHP, Laravel, and Testbench constraints. - Check changed code against the lowest Laravel release
composer.jsonallows (13.0.0) and PHP 8.3+ syntax before adopting newer framework or language features. PHP 8.4 syntax such as property hooks is a parse error on 8.3. Do not call PHP 8.4 functions such asarray_any()directly: Laravel'sArr::first(),Arr::some()andArr::every()cover them, the latter two with a closure that takesmixed, as PHPStan rejects a narrower one. - Review
.github/workflows/tests.ymlfor dependency stability lanes, prefer-lowest coverage, prefer-stable coverage, and Windows concerns. The prefer-lowest lane turns off Composer's blocking of releases with security advisories, as it would otherwise never install Laravel 13.0; locally, test the floor in a copy withcomposer config policy.advisories.block false. - When changing dependencies, confirm constraints still allow the intended Laravel and Testbench versions.
- Validate with the smallest local command available, then rely on CI for full OS and dependency matrix coverage.
References
composer.json.github/workflows/tests.ymlphpstan.neon.disttests/workbench/
Examples
- Review a new Laravel API call by checking whether it exists in Laravel 13.0.0, the lowest version
composer.jsonallows, before merging it into shared package code. - Review a dependency bump by checking Composer constraints, Testbench constraints, prefer-lowest behavior, and Windows path assumptions.
Anti-Patterns
- Assuming the latest local dependency version represents the whole support matrix.
- Adding PHP syntax or Laravel APIs that exceed
composer.jsonconstraints. - Ignoring Windows path separators, executable assumptions, or shell-only syntax in tests and workflows.
- Removing dependency stability lanes because they are slower than a single happy path.