lundi 11 janvier 2016

Laravel 5 eloquent inlcude the row of the other table from the foreign key of the 2nd joined table

I have 3 sample models

  1. customer

    id

  2. order

    id

    customer_id

    deliver_address_id

  3. customer_address

    id customer_id

    street

    country

A customer can save many addresses on his profile but he can only choose one address per order.

I would like to get all customer orders including the address in one query using laravel 5 eloquent.I'm new in laravel so having difficulty to query complex relationship tables. I hope someone can help me..Thanks



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire