8000 [Refactor] Use route key name as default cursor key name · AxonDivisionDev/laravel-json-api@163399b · GitHub
[go: up one dir, main page]

Skip to content

Commit 163399b

Browse files
committed
[Refactor] Use route key name as default cursor key name
Closes cloudcreativity#237
1 parent 4c9f2a8 commit 163399b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Pagination/CursorBuilder.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,7 @@ private function guessColumn()
341341
private function guessKey()
342342
{
343343
if ($this->query instanceof EloquentBuilder || $this->query instanceof Relation) {
344-
return $this->query->getModel()->getKeyName();
344+
return $this->query->getModel()->getRouteKeyName();
345345
}
346346

347347
return 'id';

0 commit comments

Comments
 (0)
0