request = $request; $this->where = $where; } /** * Apply criteria in query repository * * @param Builder|Model $model * @param RepositoryInterface $repository * * @throws \Exception * * @return mixed */ public function apply($model, RepositoryInterface $repository) { if ($this->where) { $model = $model->where($this->where); } return $model; } }