Laravel Eloquent Relationships

One to One

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 users.id field. Eloquent will handle the rest.

// app/User.php

...

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

...

To save a one-to-one relationship:

$user->address()->save($address);