search = $search; } /** * @param $model * @param RepositoryInterface $repository * @return mixed */ public function apply($model, Repository $repository) { if(isset($this->search['keyword']) && $this->search['keyword']) { $keyword = '%'.$this->search['keyword'].'%'; $model = $model->where([['title','like',$keyword]]); } return $model; } }