Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

laravel eloquent many to many query using whereHas

$dogs = Dog::whereHas('owners', function($q) use($ownerIds) {
    $q->whereIn('id', $ownerIds);
})->get();
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #laravel #eloquent #query #whereHas
ADD COMMENT
Topic
Name
8+7 =