vendredi 16 novembre 2018

How to use hasManyThrow relationship with multiple keys in Eloquent Laravel 5


Suppose that I have following tables:
1. sizes table:
+ id
+ name
+ ...
2. materials table:
+ id
+ name
+ ...
3. prices table:
+ size_id
+ material_id
+ price
+ ...
4. products table:
+ id
+ name
+ ...
5. product_size table:
+ product_id
+ size_id
6. product_material table:
+ product_id
+ material_id

My question is How to get list of Prices from Product Model through hasManyThrow relationship ?

Thank you



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire