Level 102
You need to nest it. https://laravel.com/docs/9.x/queries#logical-grouping
$mypasswords = MyPassword::query($this->search)
->select('id','title','user_name','url','notes','password','user_id')
->where('user_id','=',auth()->id())
->where(function($query) {
$query->orWhere('id','like','%'.$this->search.'%')
->orWhere('title','like','%'.$this->search.'%')
->orWhere('url','like','%'.$this->search.'%')
->orWhere('user_name','like','%'.$this->search.'%')
->orWhere('notes','like','%'.$this->search.'%');
})
->orderBy($this->orderBy,$this->sort)
->paginate($this->perPage);
1 like