Отношения
Один-к-ОдномуОдин-ко-МногимМногие-ко-Многим
users
id
name
profiles
id
user_id
titleclass User extends Model
{
public function profile()
{
return $this->hasOne(Profile::class);
}
}class Profile extends Model
{
public function user()
{
return $this->belongsTo(User::class);
}
}Last updated