Не получается настроить фильтрацию.
public function index(OrderFilter $filter): View
{
$items = Order::withTrashed()->filter($filter)->paginate(10);
return view($this->viewsPath . self::INDEX_ACTION, [
'items' => $items,
'perPage' => 10,
]);
}
Получаю ошибку Call to undefined method Illuminate\Database\Eloquent\Builder::filter()
Когда убираю filter($filter)
, ошибка пропадает, фильтрация не работает.
Как правильно настроить фильтрацию?
where:
$first = DB::table('orders')
->where('id');
$items = DB::table('orders')
->where('id')
->union($first)
->get();
Method Illuminate\Support\Collection::links does not exist.