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