Closed schubertadam closed 1 month ago
Hi, is there any way to use Model::search method via with() function? I'd like to search through my User model which has Role This is my original code: User::with('roles')->paginate($this->paginate)
User::with('roles')->paginate($this->paginate)
So my question is, how can I make it searchable?
Try User::search($searchPhrase)->query(function($builder) { $builder->with('roles') })->paginate($this->paginate)
Hi, is there any way to use Model::search method via with() function? I'd like to search through my User model which has Role This is my original code:
User::with('roles')->paginate($this->paginate)
So my question is, how can I make it searchable?