lundi 21 août 2017

How to Constraining Eager Loads With whereIn function Laravel

How to pass controls to with function

$controls = $project['records']->pluck('id');

    $domain = ProcessDomain::with(['process.subprocess.control' => function ($query,$controls) {
        $query->whereIn ('id', $controls);
    }])->get();



from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/2x4R56l
via IFTTT

Aucun commentaire:

Enregistrer un commentaire