Skip to content

Commit c55e5c4

Browse files
committed
Support custom route key
1 parent 0454e21 commit c55e5c4

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/Http/Requests/Concerns/InteractWithRepositories.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,8 @@ public function viaQuery(): Relation
9090

9191
public function modelQuery(?string $repositoryId = null, ?string $uriKey = null): Builder|Relation
9292
{
93-
return $this->newQuery($uriKey)->whereKey(
93+
return $this->newQuery($uriKey)->where(
94+
$this->model()->getRouteKeyName(),
9495
$repositoryId ?? $this->route('repositoryId')
9596
);
9697
}

0 commit comments

Comments
 (0)