Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SQL

laravel eloquent with query parameter

$campaign = Campaign::find($campaign_id);
    $buyers = $campaign->buyers()->with('notes')->with(['emails' => function($q) use ($campaign_id){
        $q->where('campaign_id', $campaign_id);
    }])->get();
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #laravel #eloquent #query #parameter
ADD COMMENT
Topic
Name
6+6 =