RadioDeck::make('is_status')
->label('Status')
->options([
'0' => 'No',
'1' => 'Yes',
])
->descriptions([
'0' => 'Record with status Non-Active',
'1' => 'Data with status Active',
])
->default(0)
->required()
->alignment(Alignment::Start)
->color('primary')
->extraCardsAttributes([
'class' => 'rounded-xl',
])
->live()
->columns(2)
->columnSpanFull()
->afterStateUpdated(function (?string $state, ?string $old, callable $set) {
if ($old) {
$set('description', null);
}
}),
Forms\Components\Textarea::make('description')
->label('Description')
->required(fn (callable $get): bool => $get('is_status'))
->disabled(fn (callable $get): bool => !$get('is_status'))
->rows(5)
->autosize()
->extraInputAttributes([
'oninput' => 'this.value = this.value.toUpperCase()',
'required' => false,
])
->dehydrateStateUsing(fn (?string $state) => $state ? strtoupper($state) : '')
->columnSpanFull(),
RadioDeck::make('is_status')
->label('Status')
->options([
'0' => 'No',
'1' => 'Yes',
])
->descriptions([
'0' => 'Record with status Non-Active',
'1' => 'Data with status Active',
])
->default(0)
->required()
->alignment(Alignment::Start)
->color('primary')
->extraCardsAttributes([
'class' => 'rounded-xl',
])
->live()
->columns(2)
->columnSpanFull()
->afterStateUpdated(function (?string $state, ?string $old, callable $set) {
if ($old) {
$set('description', null);
}
}),
Forms\Components\Textarea::make('description')
->label('Description')
->required(fn (callable $get): bool => $get('is_status'))
->disabled(fn (callable $get): bool => !$get('is_status'))
->rows(5)
->autosize()
->extraInputAttributes([
'oninput' => 'this.value = this.value.toUpperCase()',
'required' => false,
])
->dehydrateStateUsing(fn (?string $state) => $state ? strtoupper($state) : '')
->columnSpanFull(),