dimanche 22 avril 2018

How can this be done with the relationship, and is it worth it? (Get all departments for clinic)

I have 3 tables:

clinics

clinics

departments

Departmens

clinics_in_departments

clinics_in_departments

$department = ClinicsInDepartment::whereIn('clinic_id',[1,2,3])
            ->join('departments', 'clinics_in_departments.clinic_id', '=', 'department.id')
            ->get();

How can this be done with the relationship, and is it worth it?



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

Aucun commentaire:

Enregistrer un commentaire