Skip to content
recai edited this page May 8, 2017 · 3 revisions
namespace App\Whatever\Api\Controllers;

use App\Http\Requests;
use App\User;
use Illuminate\Http\Request;

// Add this line
use Unlu\Laravel\Api\QueryBuilder;

class UsersController extends Controller
{
  public function index(Request $request)
  {
    $queryBuilder = new QueryBuilder(new User, $request);
    
    return response()->json([
      'data' => $queryBuilder->build()->paginate(),
      .
      .
    ]);
  }
}