Sorting related model
Opened this issue · 0 comments
t0n1zz commented
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?