Rajunda
Rajunda
FFilament
Created by Rajunda on 6/27/2024 in #❓┊help
Upload image directly
I want to resize and store the image directly after being uploaded (using default FileUpload from filament), and save it to the records while I'm editing a form, any Idea how I can achieve that?
4 replies
FFilament
Created by Rajunda on 6/18/2024 in #❓┊help
Required and Disabled with condition in TextArea are not working
I have radiodeck plugin and textarea in my form
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(),
Even though I have 'disabled' set to false in extraInputAttributes, it is still not functioning as it should. I tweak the necessary rule by setting 'required' to false in extraInputAttributes and it's working fine (without it, it's still have required in textarea even though is_status is set to false). What I want is for the textarea to be disabled while is_status is non-active and to not be disabled when is_status is active note: when I change textarea to textinput, it works as I wanted to be
1 replies
FFilament
Created by Rajunda on 6/4/2024 in #❓┊help
Number of pages in pagination suddenly disappeared
No description
37 replies
FFilament
Created by Rajunda on 2/5/2024 in #❓┊help
Fabricator: Header blocks for all blocks
No description
1 replies
FFilament
Created by Rajunda on 1/15/2024 in #❓┊help
createOptionForm field validation
No description
1 replies
FFilament
Created by Rajunda on 12/20/2023 in #❓┊help
duplicate query
No description
1 replies