Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

how to pass parameters to relationships laravel

$users = User::with(['posts' => function($query)
{
    $query->where('title', 'like', '%first%');

}])->get();
Source by laravel.com #
 
PREVIOUS NEXT
Tagged: #pass #parameters #relationships #laravel
ADD COMMENT
Topic
Name
3+2 =