vendredi 18 février 2022

Eloquent ORM Query

My query is that

 $uploadedSC = SC::select('id')->with(['cont'=> function ($q) {
                return $q->with('crs:id,title')->select('*');
            }])->where('act', true)->get();

But I wanna add ->where('act',true) query to crs table. But giving error. How can i write this query?

 $uploadedSC = SC::select('id')->with(['cont'=> function ($q) {
                    return $q->with('crs:id,title')->where('act',true)->select('*');
                }])->where('act', true)->get();


from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/ZhgkpNz
via IFTTT

Aucun commentaire:

Enregistrer un commentaire