Skip to content

Commit

Permalink
Support custom route key (#603)
Browse files Browse the repository at this point in the history
  • Loading branch information
robin-dongbin authored Nov 30, 2024
1 parent a20f4d1 commit 6c1d6d6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Http/Requests/Concerns/InteractWithRepositories.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,8 @@ public function viaQuery(): Relation

public function modelQuery(?string $repositoryId = null, ?string $uriKey = null): Builder|Relation
{
return $this->newQuery($uriKey)->whereKey(
return $this->newQuery($uriKey)->where(
$this->model()->getRouteKeyName(),
$repositoryId ?? $this->route('repositoryId')
);
}
Expand Down

0 comments on commit 6c1d6d6

Please sign in to comment.