Toggle with eager loading in form

Why eager load works in table but not form?

UserModel
public function notificationPreference(): HasOne
    {
        return $this->hasOne(UserNotificationPreference::class);
    }


UserResource
Forms\Components\Toggle::make('notificationPreference.is_enabled')

Is there any alternatives?
Solution
Use

Group::make([
Toggle::make('is_enabled')
])->relationship('notificationPreference')
Was this page helpful?