It depends. You can save user_id in the addresses table OR address_id in the users table. For the one-to-one relationship, you can choose between those options. But the best practice is, use user_id in the addresses table.

For the one-to-many relationship, I assume a user can have multiple addresses; then, the user_id must exist in the addresses table.

As you can see, one-to-one and one-to-many relationships have the same database structure. The only difference is located in the Eloquent ORM model, where one-to-one use hasOne() and belongsTo() methods, and one-to-many use hasMany() and belongsTo() methods.


PHP/Backend Engineer at Undercurrent Capital Pte Ltd — Data Science Enthusiast

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store