Отношения

Один-к-Одномуchevron-right
users
    id
    name
    
profiles
    id
    user_id
    title
class User extends Model
{
    public function profile()
    {
        return $this->hasOne(Profile::class);
    }
}
class Profile extends Model
{
    public function user()
    {
        return $this->belongsTo(User::class);
    }
}
Один-ко-Многимchevron-right
chevron-rightМногие через отношениеhashtag

mechanic hasMany cars cars hasMany owners значит можно достать всех владельцев всех машин конкретного механика mechanic hasManyThrough(Owner::class,Car::class);

Многие-ко-Многимchevron-right

Last updated