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

Sorting related model #6

Open
t0n1zz opened this issue Mar 22, 2018 · 0 comments
Open

Sorting related model #6

t0n1zz opened this issue Mar 22, 2018 · 0 comments

Comments

@t0n1zz
Copy link

t0n1zz commented Mar 22, 2018

so i find your sorting code not working if we are sorting related model and i find elsewhere the solution is doing something like this

$users = App\User::with(['posts' => function ($query) {
    $query->orderBy('created_at', 'desc');
}])->get();

but i don't know how to add that into FilterPaginateOrder trait so it will also work with related model sorting... can you help me please?

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