Skip to content

Commit 5b34216

Browse files
authored
Add limit to relations
It is currently not possible to add a limit to the relations. This will allow limiting relations.
1 parent fbfdb66 commit 5b34216

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/Drivers/Standard/QueryBuilder.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -626,6 +626,10 @@ public function applyIncludesToQuery($query, Request $request, array $includeDes
626626
) {
627627
$relationQueryBuilder = $this->clone($relationModelClass);
628628

629+
if(array_key_exists("limit", $includeDescriptor)) {
630+
$includeQuery->take($includeDescriptor["limit"]);
631+
}
632+
629633
$relationQueryBuilder->applyFiltersToQuery(
630634
$includeQuery,
631635
$request,

0 commit comments

Comments
 (0)