params = $params; } /** * @param Builder $model * @param RepositoryInterface $repository * @return mixed */ 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', 'like', '%' . $this->params['name'] . '%'); } return $model; } }