I have below query that works fine.
\App\Models\Membership\MembershipModel
::with(['Packages' => function($query){
$query->where('ExperienceID', \Auth::user()->ExperienceID)
;
}])
->get();
In this above query I applied filter and works fine . Issue comes when I add more relation table and filter don't work at all.
\App\Models\Membership\MembershipModel
::with(['Packages' => function($query){
$query->where('ExperienceID', \Auth::user()->ExperienceID)
;
}])
->with('Packages.AssetTypes')
->get();
Please suggest why filter does not work after adding the relational table
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire