php - Laravel - Eloquent where with relationship? -
i have following code:
return technology::wherein('uuid', $technologies)->get();
$technologies array of uuids , in $technologies table have uuid field.
so return technologies match uuids, have equipment_id in technologies table , end game goal list of equipment id's belong technologies match uuids in $technologies variable.
i foreach loop , add equipment id's array wondering if there way eloquent magic include equipment relationship query.
something this: (this doesn't work)
return technology::wherein('uuid', $technologies)->equipment->get();
i think called "has many through" relationship.
i answered same question at:
Comments
Post a Comment