Fill form data when a specific field changes

Hello,
I have this form:
$form->schema([
    Forms\Components\TextInput::make('hourly_price')
        ->label(trans('admin.room.hourly_price'))
        ->numeric()
        ->default(0)
        ->required(),
    Forms\Components\TextInput::make('daily_price')
        ->label(trans('admin.room.daily_price'))
        ->numeric()
        ->default(0)
        ->required(),
    Forms\Components\TextInput::make('monthly_price')
        ->label(trans('admin.room.monthly_price'))
        ->numeric()
        ->default(0)
        ->required(),
]);


I want when hourly_price value changes I calculate the daily_price and monthly_price and fill them automatically. How can I implement this? I tried using afterStateUpdated but it seems that I cannot access all the form data and manipulate the values.
Was this page helpful?