-
-
Save Quix0r/d1cc77a88950d9bf419e4dea330b10eb to your computer and use it in GitHub Desktop.
Revisions
-
vluzrmos created this gist
Jul 20, 2016 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,19 @@ <?php /** * Gera a paginação dos itens de um array ou collection. * * @param array|Collection $items * @param int $perPage * @param int $page * @param array $options * * @return LengthAwarePaginator */ public function paginate($items, $perPage = 15, $page = null, $options = []) { $page = $page ?: (Paginator::resolveCurrentPage() ?: 1); $items = $items instanceof Collection ? $items : Collection::make($items); return new LengthAwarePaginator($items->forPage($page, $perPage), $items->count(), $perPage, $page, $options); }