v5.0.0 - PHP 8.2+, Laravel 11+, dependency and tooling updates
What's Changed
This is a major release. It raises the minimum supported PHP and Laravel versions, updates every development dependency to its latest major version, and tightens static analysis. There are no changes to the package's public API, Blade components, routes, or configuration keys.
Breaking changes
- PHP 8.2 or newer is required (
"php": "^8.2"). PHP 8.0 and 8.1 are no longer supported. - Laravel 11 or newer is required (
illuminate/contracts: ^11.0|^12.0|^13.0). The package previously declared no Laravel constraint. - Config values are now type checked. The controller reads
cookies_consent.cookie_lifetimewithconfig()->integer()andcookies_consent.cookie_prefixwithconfig()->string(). A lifetime that is not an integer, for example a string coming fromenv(), now throws anInvalidArgumentExceptioninstead of being coerced silently. Cast such values in your published config:'cookie_lifetime' => (int) env('COOKIE_LIFETIME', 365).
Supported versions
| Laravel | PHP |
|---|---|
| 12 | 8.2, 8.3, 8.4 |
| 13 | 8.3, 8.4 |
Every combination above is tested in CI with both prefer-lowest and prefer-stable dependency resolution.
Development dependencies
- Orchestra Testbench 11, Pest 4, PHPUnit 12, Laravel 13 (previous majors remain allowed so the Laravel 12 matrix jobs can resolve).
- ESLint 10,
eslint-plugin-jsdoc64, jsdom 30, c8 12.@eslint/jsandglobalsare now explicit dev dependencies because ESLint 10 no longer ships them transitively. - Rector, Rector Laravel and Larastan updated to their latest minor versions.
Static analysis
- PHPStan level raised from 4 to 9 with an empty baseline.
- A
testbench.yaml.distregisters the service provider so Larastan can resolve thecookies_consent::view namespace.
CI hardening
npm ci --ignore-scriptsin all workflows.- The coverage job installs from
composer.lockinstead of re-resolving. - Removed an unpinned
npm install -g npm@lateststep from the Dependabot auto-merge workflow.
Upgrading
- Make sure your application runs PHP 8.2 or newer on Laravel 11 or newer.
- Run
composer require scify/laravel-cookie-guard:^5.0. - If your published
config/cookies_consent.phpreadscookie_lifetimeorcookie_prefixfromenv(), cast them tointandstringrespectively.