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