vendredi 28 août 2015

Bidrectional many 2 many morph models in Laravel

I have 4 different models: - People - Cars - Offices

So there are many2many relationships between all 3:

People <-> Cars
Cars <-> Offices
People <-> Offices

Is there a way I can define a single Pivot Table with double morph, having a MySQL table like this

- id
- target_id
- target_type
- source_id
- source_type

This way I could add any new model it comes into the picture.



from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/1JnYeNq
via IFTTT

Aucun commentaire:

Enregistrer un commentaire