Почему в методе, определяющем relation не видны атрибуты модели???
public function userAttributes()
{
// хочу получтить здесь id ($user->id)
dd($this->id); // null
return $this->siteUserAttributes()
->with([
'userAttributes' => function($query) {
$query->where('user_id', '=', $this->id);
}
]);
}