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([['id','like',$keyword],['store_id',$this->store_id]]) ->orwhere([['store_id','like',$keyword],['store_id',$this->store_id]]) ->orwhere([['name','like',$keyword],['store_id',$this->store_id]]); } return $model; } }