Out with PHP 8.1, in with PHP 8.4
PHP 8.1 reached its end of active support life over a year ago (security support will continue until EOY 2025). I have dropped support for PHP 8.1 (you can continue using it if you're on the 6.x release), and I've formally added support for PHP 8.4.
Relation Generics
There was also a change within Laravel 11 (#51851) which added generics to relations. I've updated the static analysis within this package to support those generics as well. There may be additional changes in the future as people start trying out query scopes within joins, as PHPStan/Larastan should now be able to detect that the join clause is for a specific model.
Breaking Change
The dynamic addition of properties has been deprecated in PHP 8.4, so the ability to modify join types via $join->type = 'left'
has been removed, as it relied on this feature. You'll have to piece together your joins in another manner now.
Before:
User::query()->joinRelation('posts.comments', [
'comments' => function ($join) { $join->type = 'left'; }
});
After:
User::query()
->joinRelation('posts')
->leftJoinThroughRelation('posts.comments');