Last active
February 23, 2019 04:29
-
-
Save rslhdyt/aa07a99cc2ac3e6bd35fd461258f4341 to your computer and use it in GitHub Desktop.
Custom Pagination URL laravel
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 characters
<?php | |
class UserController extends Controller | |
{ | |
public function index() | |
{ | |
$users = App\Models\Member::paginate(15, ['*'], "page[limit]"); | |
$users->appends(['name' => 'bertho']); | |
$data = $users->toArray(); | |
$response = [ | |
'data' => $data['data'], | |
'meta' => array_except($data, 'data') | |
]; | |
return $response; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment