Ability to set perPageOptions for Lenses #4198
-
I have a lens which I want to limit the per-page options for. However, I am unable to do this. I would have hope the The // LensRequest.php
public function perPage()
{
$resource = $this->resource();
$perPageOptions = $resource::perPageOptions();
if (empty($perPageOptions)) {
$perPageOptions = [$resource::newModel()->getPerPage()];
}
return (int) in_array($this->perPage, $perPageOptions) ? $this->perPage : $perPageOptions[0];
} The // ResourceIndexRequest.php
public function perPage()
{
$resource = $this->resource();
if ($this->viaRelationship()) {
return (int) $resource::$perPageViaRelationship;
}
$perPageOptions = $resource::perPageOptions();
if (empty($perPageOptions)) {
$perPageOptions = [$resource::newModel()->getPerPage()];
}
return (int) in_array($this->perPage, $perPageOptions) ? $this->perPage : $perPageOptions[0];
} |
Beta Was this translation helpful? Give feedback.
Answered by
crynobone
Feb 2, 2025
Replies: 1 comment 1 reply
-
Will be available in 5.2.0 |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
crynobone
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Will be available in 5.2.0