Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using resources #50

Open
PatrickSTM opened this issue Oct 22, 2019 · 0 comments
Open

Using resources #50

PatrickSTM opened this issue Oct 22, 2019 · 0 comments

Comments

@PatrickSTM
Copy link

PatrickSTM commented Oct 22, 2019

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant