-
-
Save ctf0/109d2945a9c1e7f7f7ea765a7c638db7 to your computer and use it in GitHub Desktop.
Revisions
-
ctf0 revised this gist
May 19, 2025 . 1 changed file with 3 additions and 3 deletions.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 @@ -1,8 +1,8 @@ <?php use Illuminate\Support\Collection; use Illuminate\Pagination\Paginator; use Illuminate\Pagination\LengthAwarePaginator; /** * Gera a paginação dos itens de um array ou collection. -
ctf0 revised this gist
Jul 13, 2021 . 1 changed file with 1 addition and 1 deletion.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 @@ -13,7 +13,7 @@ * * @return LengthAwarePaginator */ public function paginate($items, $perPage = 15, $page = null, $getValues = true) { $pageName = 'page'; $page = $page ?: (Paginator::resolveCurrentPage($pageName) ?: 1); -
ctf0 revised this gist
Feb 20, 2021 . 1 changed file with 4 additions and 2 deletions.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 @@ -13,14 +13,16 @@ * * @return LengthAwarePaginator */ public function paginate($items, $perPage = 15, $page = null, , $getValues = true) { $pageName = 'page'; $page = $page ?: (Paginator::resolveCurrentPage($pageName) ?: 1); $items = $items instanceof Collection ? $items : Collection::make($items); return new LengthAwarePaginator( $getValues ? $items->forPage($page, $perPage)->values() : $items->forPage($page, $perPage), $items->count(), $perPage, $page, -
ctf0 revised this gist
Nov 9, 2019 . 1 changed file with 6 additions and 1 deletion.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 @@ -1,4 +1,9 @@ <?php // use Illuminate\Support\Collection; // use Illuminate\Pagination\Paginator; // use Illuminate\Pagination\LengthAwarePaginator; /** * Gera a paginação dos itens de um array ou collection. * @@ -24,4 +29,4 @@ public function paginate($items, $perPage = 15, $page = null) 'pageName' => $pageName, ] ); } -
ctf0 revised this gist
Jun 22, 2018 . 1 changed file with 1 addition and 2 deletions.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 @@ -3,9 +3,8 @@ * Gera a paginação dos itens de um array ou collection. * * @param array|Collection $items * @param int $perPage * @param int $page * * @return LengthAwarePaginator */ -
ctf0 revised this gist
Jun 22, 2018 . 1 changed file with 14 additions and 5 deletions.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 @@ -9,11 +9,20 @@ * * @return LengthAwarePaginator */ public function paginate($items, $perPage = 15, $page = null) { $pageName = 'page'; $page = $page ?: (Paginator::resolveCurrentPage($pageName) ?: 1); $items = $items instanceof Collection ? $items : Collection::make($items); return new LengthAwarePaginator( $items->forPage($page, $perPage)->values(), $items->count(), $perPage, $page, [ 'path' => Paginator::resolveCurrentPath(), 'pageName' => $pageName, ] ); } -
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); }