Skip to content

v5.0.0 - PHP 8.2+, Laravel 11+, dependency and tooling updates

Choose a tag to compare

@PavlosIsaris PavlosIsaris released this 03 Sep 07:48
· 17 commits to main since this release
cb7a365

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_lifetime with config()->integer() and cookies_consent.cookie_prefix with config()->string(). A lifetime that is not an integer, for example a string coming from env(), now throws an InvalidArgumentException instead 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-jsdoc 64, jsdom 30, c8 12. @eslint/js and globals are 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.dist registers the service provider so Larastan can resolve the cookies_consent:: view namespace.

CI hardening

  • npm ci --ignore-scripts in all workflows.
  • The coverage job installs from composer.lock instead of re-resolving.
  • Removed an unpinned npm install -g npm@latest step from the Dependabot auto-merge workflow.

Upgrading

  1. Make sure your application runs PHP 8.2 or newer on Laravel 11 or newer.
  2. Run composer require scify/laravel-cookie-guard:^5.0.
  3. If your published config/cookies_consent.php reads cookie_lifetime or cookie_prefix from env(), cast them to int and string respectively.