You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have not yet fully checked why it has worked before and why it throws an error now, but I guess there might have been a restructuring in the inheritance hierarchy of the relation classes so that HasOneThrough relation is not allowed anymore due to the failing instanceof check.
My example code, although simplified a bit, is still a bit too complicated, but I think the error message speaks for itself anyway:
I released a new version with the fix. The issue was that HasOneThrough no longer is a subclass of HasManyThrough and so $relation instanceof HasManyThrough isn't true anymore.
staudenmeir/eloquent-has-many-deep: v1.20.1
laravel/framework: v11.15.0
Since updating from Laravel 10 to 11 my
previewFile
relation doesn't work anymore.The exception is quite obvious:
The error comes from the following function in Staudenmeir\EloquentHasManyDeep\Eloquent\Traits\ConcatenatesNativeRelationships
I have not yet fully checked why it has worked before and why it throws an error now, but I guess there might have been a restructuring in the inheritance hierarchy of the relation classes so that HasOneThrough relation is not allowed anymore due to the failing
instanceof
check.My example code, although simplified a bit, is still a bit too complicated, but I think the error message speaks for itself anyway:
App\Models\Job.php
App\Models\Task.php:
The text was updated successfully, but these errors were encountered: