One to one relationships are very straightforward in Laravel. Make sure that one of the tables has a key that references the id of the other table.

For example, an addresses table will have a field called user_id. That will reference the field. Eloquent will handle the rest.

// app/User.php


public function address() {
    return  his->hasOne('App\Address');


To save a one-to-one relationship:

Table of Contents


    Chris Sevilleja

    173 posts

    Founder of Google Developer Expert in Web Technologies. Slapping the keyboard until something good happens.