In the documentation (Usage) is the following code snippet:
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(),
.
.
]);
}
}
I had already defined resources for my models. Your code snippet will ignore the resources. Is there a way to use it with my resources? Because in my resources are defined, which data will be showed and i defined custom names for the output.
In the documentation (Usage) is the following code snippet:
I had already defined resources for my models. Your code snippet will ignore the resources. Is there a way to use it with my resources? Because in my resources are defined, which data will be showed and i defined custom names for the output.