diff --git a/src/Fieldtypes/Entries.php b/src/Fieldtypes/Entries.php index 655827b7f9..dbe2a6a30f 100644 --- a/src/Fieldtypes/Entries.php +++ b/src/Fieldtypes/Entries.php @@ -10,7 +10,6 @@ use Statamic\Http\Resources\CP\Entries\Entries as EntriesResource; use Statamic\Http\Resources\CP\Entries\Entry as EntryResource; use Statamic\Query\Scopes\Filters\Concerns\QueriesFilters; -use Statamic\Support\Str; class Entries extends Relationship { @@ -71,9 +70,7 @@ public function getIndexItems($request) $query->orderBy($sort, $this->getSortDirection($request)); } - $shouldPaginate = $request->has('paginate') ? Str::toBool($request->paginate) : true; - - $items = $shouldPaginate ? $query->paginate() : $query->get(); + $items = $request->boolean('paginate', true) ? $query->paginate() : $query->get(); return $items->preProcessForIndex(); } diff --git a/src/Fieldtypes/Terms.php b/src/Fieldtypes/Terms.php index 9e2145b452..8da2c354bf 100644 --- a/src/Fieldtypes/Terms.php +++ b/src/Fieldtypes/Terms.php @@ -146,9 +146,7 @@ public function getIndexItems($request) $query->orderBy($sort, $this->getSortDirection($request)); } - $shouldPaginate = $request->has('paginate') ? Str::toBool($request->paginate) : true; - - return $shouldPaginate ? $query->paginate() : $query->get(); + return $request->boolean('paginate', true) ? $query->paginate() : $query->get(); } public function getResourceCollection($request, $items)