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('name', 'like','%'.$this->search['keyword'].'%'); } $model = $model->where('store_id', $this->search['store_id']); return $model; } }