Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/model/relation/HasManyThrough.php
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,9 @@
$throughKey = $this->throughKey;

if ($this->baseQuery) {
$throughKey = Str::snake(class_basename($this->model)) . '.' . $this->throughKey;
$alias = Str::snake(class_basename($this->model));
$throughKey = $alias . '.' . $this->throughKey;
$this->query->alias($alias);

Check warning on line 275 in src/model/relation/HasManyThrough.php

View check run for this annotation

Codecov / codecov/patch

src/model/relation/HasManyThrough.php#L273-L275

Added lines #L273 - L275 were not covered by tests
}

$withLimit = $this->query->getOptions('limit');
Expand Down
Loading