params = $params; } public function apply($model, RepositoryInterface $repository) { if (!empty($this->params['status'])) { $model = $model->where('status', $this->params['status']); } if (!empty($this->params['name'])) { $model = $model->where('name', $this->params['name']); } if (!empty($this->params['type'])) { $model = $model->where('type', $this->params['type']); } return $model; } }