Skip to content

Fix PHP 8.3 and Laravel 10 compatibility#361

Merged
freekmurze merged 2 commits into
spatie:mainfrom
christopheraseidl:main
Jul 25, 2025
Merged

Fix PHP 8.3 and Laravel 10 compatibility#361
freekmurze merged 2 commits into
spatie:mainfrom
christopheraseidl:main

Conversation

@christopheraseidl

Copy link
Copy Markdown
Contributor

Description

This PR fixes compatibility issues between composer.json requirements and the GitHub Actions workflow, enabling support for PHP 8.3+ and Laravel 10+.

Problem

The current template has several compatibility issues:

  • composer.json requires PHP ^8.4, but the workflow tests against PHP 8.3
  • Laravel 10 requires Pest v2, but composer.json only allows Pest v3
  • The workflow uses a wildcard version for testbench (8.*) which can install incompatible versions during prefer-lowest installations

Solution

composer.json changes:

  • Lower PHP requirement from ^8.4 to ^8.3 to match the workflow matrix
  • Add support for Pest v2 alongside v3 (^2.0||^3.0) for Laravel 10 compatibility
  • Update pest plugin constraints to support both v2 and v3 versions

Workflow changes:

  • Change testbench from wildcard (8.*) to caret (^8.22) to ensure compatible versions

Testing

I've created a test package that demonstrates these changes work correctly: https://github.com/christopheraseidl/test-skeleton-patch

This test package shows:

  • Successful installation with PHP 8.3 and Laravel 10
  • All tests passing with the updated dependencies
  • No conflicts during prefer-lowest installations

Change testbench version from wildcard (8.*) to caret (^8.22) to prevent
installation of incompatible versions during prefer-lowest installations.
- Lower PHP requirement from ^8.4 to ^8.3 to align with run-tests.yml
- Add support for Pest v2 alongside v3 (^2.0||^3.0) for Laravel 10 compatibility
- Adjust pest plugin constraints to support both v2 and v3
- pestphp/pest-plugin-arch ^2.5 required for arch() method support
@freekmurze freekmurze merged commit fa5da81 into spatie:main Jul 25, 2025
1 check passed
@freekmurze

Copy link
Copy Markdown
Member

Thanks!

fzengin19 pushed a commit to fzengin19/laravel-subscription-guard that referenced this pull request Mar 6, 2026
Fix PHP 8.3 and Laravel 10 compatibility
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants