laravel nested wherehas

Solutions on MaxInterview for laravel nested wherehas by the best coders in the world

showing results for - "laravel nested wherehas"
Ilyes
17 May 2018
1// given $user and $search:
2$packages = Package::where('alias','like',"%$search%")
3  ->whereHas('product.membership.club.user', function ($q) use ($user) {
4    $q->whereId($user->id);
5  })->get();
6