Answers for "laravel nested wherehas"

PHP
2

laravel nested wherehas

// given $user and $search:
$packages = Package::where('alias','like',"%$search%")
  ->whereHas('product.membership.club.user', function ($q) use ($user) {
    $q->whereId($user->id);
  })->get();
Posted by: Guest on March-02-2021

Code answers related to "laravel nested wherehas"

Browse Popular Code Answers by Language