So basically, I have 4 tables.
Table 1: Fylker (Counties) Table 2: Kommuner (Municipalities) Table 3: Poststed (Postal) Table 4: Postnumre (Zip)
I'm currently using Laravel 5.3 and the databases are setup and seeded. Now, what I'm wondering about, should I use 4 different models for this? Every table has relations to the previous.
What I want is to get a row from Fylker, then use some relation to get the Kommuner associated with the Fylke, and with another relation get all associated Poststeder and another relation to get all the Postnumre.
Something like this is what I want to achieve:
$fylke -> kommuner -> poststeder -> postnumre;
How would I do this?
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire