request = $request; } /** * @param $model * @param RepositoryInterface $repository * * @return mixed */ public function apply($model, RepositoryInterface $repository) { if ($this->request->filled('complaint_id')) { $complaint_id = $this->request->get('admin_id'); $model = $model->where('complaint_id', '=', $complaint_id); } return $model; } }