diff --git a/src/Macros/CollectionMacros.php b/src/Macros/CollectionMacros.php new file mode 100644 index 0000000..734b471 --- /dev/null +++ b/src/Macros/CollectionMacros.php @@ -0,0 +1,54 @@ + $this + */ + return new LengthAwarePaginator( + $this->forPage($page, $perPage)->toArray(), + $this->count(), + $perPage, + $page, + [ + ...$options, + 'path' => LengthAwarePaginator::resolveCurrentPath(), + 'query' => request()->query(), + ] + ); + }); + } + } +}