Forms\Components\Fieldset::make(__('Booking review'))
//create only if there are values, if null delete
->relationship('review')
->schema([
Forms\Components\TextInput::make('rating')
->requiredWith('comment'),
Forms\Components\Textarea::make('comment')
->columnSpan(2),
])
->visibleOn('edit')
->visible(function (Forms\Get $get): bool {
return $get('status') === 'in review';
}),
Forms\Components\Fieldset::make(__('Booking review'))
//create only if there are values, if null delete
->relationship('review')
->schema([
Forms\Components\TextInput::make('rating')
->requiredWith('comment'),
Forms\Components\Textarea::make('comment')
->columnSpan(2),
])
->visibleOn('edit')
->visible(function (Forms\Get $get): bool {
return $get('status') === 'in review';
}),