Skip to content

Commit 752041d

Browse files
committed
Add pagination options for resources in Nova
1 parent d419651 commit 752041d

File tree

1 file changed

+19
-1
lines changed

1 file changed

+19
-1
lines changed

app/Nova/Resource.php

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,5 +62,23 @@ public static function relatableQuery(NovaRequest $request, $query)
6262
*/
6363
public static $clickAction = 'ignore';
6464

65-
public static $perPageViaRelationshipOptions = [20];
65+
/**
66+
* The pagination per-page options configured for this resource.
67+
*
68+
* @return array<int, int>
69+
*/
70+
public static function perPageOptions()
71+
{
72+
return [25, 50, 100];
73+
}
74+
75+
/**
76+
* The pagination per-page options configured for this resource via relationship.
77+
*
78+
* @return array<int, int>
79+
*/
80+
public static function perPageViaRelationshipOptions()
81+
{
82+
return [10, 25, 50];
83+
}
6684
}

0 commit comments

Comments
 (0)