1. Go to this page and download the library: Download wpzag/laravel-query-builder 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/ */
$builder = QueryBuilder::for(User:class); //This applies // Returns the eloquent collection
$builder->withPagination() // Applies pagination to the query
$builder->withAppends() // Applies appends to the query
$builder->withPaginationAndAppends() // Applies pagination & appends to the query
QueryBuilder::for(User:class)->query()->where('id', '>', 1)->get();
// Or if you are using withPagination(),withAppends() or withPaginationAndAppends() :
QueryBuilder::for(User:class, function($query){
//extra queries here
return $next($query);
})->withPaginationAndAppends();