vendredi 18 mai 2018

laravel 3 way pivot

I've one many to many relationship between Entities and Affiliated Tables, basically an affiliated can attend to many entities(example, medical services, dentist offices). One Entity can be visited by one or many affiliated. Additionaly , one or more benefits can be occupied by one affiliated in a particular entity. As shown in the image. enter image description here

I want to be able to answer queries like, which benefits where used by the affiliated in a particular entity.

Should i create a new Model, how should i rewrite the many-to-many relationship for ORM.

Thanks in advance!



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire