diff --git a/src/Database/Eloquent/RelationMixin.php b/src/Database/Eloquent/RelationMixin.php index 9baab34..581d778 100644 --- a/src/Database/Eloquent/RelationMixin.php +++ b/src/Database/Eloquent/RelationMixin.php @@ -6,9 +6,10 @@ use Illuminate\Database\Eloquent\Builder; use Illuminate\Database\Eloquent\Relations\BelongsTo; use Illuminate\Database\Eloquent\Relations\BelongsToMany; +use Illuminate\Database\Eloquent\Relations\HasManyThrough; use Illuminate\Database\Eloquent\Relations\HasOne; use Illuminate\Database\Eloquent\Relations\HasOneOrMany; -use Illuminate\Database\Eloquent\Relations\HasOneOrManyThrough; +use Illuminate\Database\Eloquent\Relations\HasOneThrough; use Illuminate\Database\Eloquent\Relations\MorphOne; use Illuminate\Database\Eloquent\Relations\MorphOneOrMany; use Illuminate\Database\Eloquent\Relations\MorphToMany; @@ -132,7 +133,7 @@ public function getRelationExistenceInQuery(): Closure $this instanceof BelongsTo => $belongsTo($query, $parentQuery), $this instanceof BelongsToMany => $belongsToMany($query, $parentQuery), $this instanceof HasOneOrMany => $hasOneOrMany($query, $parentQuery), - $this instanceof HasOneOrManyThrough => $hasOneOrManyThrough($query, $parentQuery), + $this instanceof HasOneThrough, $this instanceof HasManyThrough => $hasOneOrManyThrough($query, $parentQuery), default => throw new LogicException( sprintf('%s must be a relationship instance.', $this::class) ) @@ -145,7 +146,7 @@ public function getRelationWhereInKey(): Closure return fn (): string => match (true) { $this instanceof BelongsTo => $this->getQualifiedForeignKeyName(), $this instanceof HasOneOrMany, $this instanceof BelongsToMany => $this->getQualifiedParentKeyName(), - $this instanceof HasOneOrManyThrough => $this->getQualifiedLocalKeyName(), + $this instanceof HasOneThrough, $this instanceof HasManyThrough => $this->getQualifiedLocalKeyName(), default => throw new LogicException( sprintf('%s must be a relationship instance.', $this::class) )