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