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();


via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire