PHP code example of vanthao03596 / laravel-cursor-paginate
1. Go to this page and download the library: Download vanthao03596/laravel-cursor-paginate library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
vanthao03596 / laravel-cursor-paginate example snippets
$users = DB::table('users')->orderBy('id')->cursorPaginate(15);
$users = User::where('votes', '>', 100)->orderBy('id')->cursorPaginate(15);
use Illuminate\Http\Resources\Json\ResourceCollection;
use Vanthao03596\LaravelCursorPaginate\HasCursorPaginate;
class YourCollectionResource extends ResourceCollection
{
use HasCursorPaginate;
public $collects = YourResource::class;
}