vendredi 18 février 2022

Eloquent ORM query

I currently have an Eloquent ORM query.

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

But I wanna add a ->where('act',true) query to my crs table. However, it gives an 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