params = $params; } public function apply($model, RepositoryInterface $repository) { if (!empty($this->params['title'])) { $model = $model->where('title', 'LIKE', '%'. $this->params['title'] .'%'); } if (!empty($this->params['is_certified'])) { $model = $model->where('is_certified', $this->params['is_certified']); } return $model; } }