Skip to content

Commit

Permalink
Add ability to limit portal results when using the Eloquent query bui…
Browse files Browse the repository at this point in the history
…lder
  • Loading branch information
Tom Kuijer committed Jul 10, 2024
1 parent cdfd2af commit 3a22918
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/Database/Eloquent/FMEloquentBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -332,4 +332,19 @@ protected function callScope(callable $scope, array $parameters = [])

return $result;
}

/**
* Set the limit of records returned for a portal on the current models' layout.
*
* @param string $portalName Name of the portal
* @param int $limit Number of records to return
*
* @return $this
*/
public function limitPortal(string $portalName, int $limit): static
{
$this->query->limitPortal($portalName, $limit);

return $this;
}
}

0 comments on commit 3a22918

Please sign in to comment.