Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support HasOneThrough #187

Merged
merged 1 commit into from
Sep 10, 2024
Merged

Support HasOneThrough #187

merged 1 commit into from
Sep 10, 2024

Conversation

AmandoVledder
Copy link
Contributor

In Laravel v11.15 the underlying HasOneThrough class changed from HasManyThrough to HasOneOrManyThrough (in laravel/framework#51851).

Which caused the package to start using performJoinForEloquentPowerJoinsForBelongsTo instead of performJoinForEloquentPowerJoinsForHasManyThrough causing a Undefined property: Illuminate\Database\Eloquent\Relations\HasOneThrough::$foreignKey exception.

This PR adds support back for HasOneThrough. I decided to not use the HasOneOrManyThrough class directly in the match statement since that class does not exist in older Laravel versions.

Copy link
Member

@luisdalmolin luisdalmolin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this!

@luisdalmolin luisdalmolin merged commit 397ef08 into kirschbaum-development:master Sep 10, 2024
8 checks passed
@AmandoVledder AmandoVledder deleted the support-has-one-through branch September 10, 2024 10:33
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