request = $request; } /** * @inheritDoc */ public function apply($model, RepositoryInterface $repository) { if ($this->request->filled('status')) { $model = $model->where('status', $this->request->get('status')); } if ($this->request->filled('shop_id')) { $shop_id = $this->request->get('shop_id'); $model = $model->where('shop_id', $shop_id); } if ($user_id = login_user_id()) { $model = $model->where('user_id', $user_id); } $model = $model->orderBy("id", 'desc'); return parent::apply($model, $repository); } }