Closed benyaminl closed 2 years ago
Forget it nvm
$data = A::query();
$data = B::query()->union($data)
if ($request->sort !=null && $request->direction !=null) {
if ($request->direction == "desc") {
$data = $data->orderByDesc($request->sort);
} else {
$data = $data->orderBy($request->sort);
}
}
$data = $data->paginate(5);
Hello, I want to ask, is there any possibility to make sortable works with Union? eg 2 diff table using union, but sortable() not works at all.