Zyten
Zyten
FFilament
Created by Zyten on 7/15/2024 in #❓┊help
Using disabledOn('edit') with fieldsets seems to make the fields empty on save
Nope. Standard Resource Form altho the form itself is quite nested
return $form
->schema([
Grid::make()
->schema([
Group::make([//fieldset here])
])
return $form
->schema([
Grid::make()
->schema([
Group::make([//fieldset here])
])
7 replies
FFilament
Created by Zyten on 7/15/2024 in #❓┊help
Using disabledOn('edit') with fieldsets seems to make the fields empty on save
Hi, I cast it like so actually:
protected function casts(): array
{
return [
'income' => 'array',
];
}
protected function casts(): array
{
return [
'income' => 'array',
];
}
And just to be clear when I said its empty, I see $data['income'] == []
7 replies
FFilament
Created by Zyten on 7/15/2024 in #❓┊help
Using disabledOn('edit') with fieldsets seems to make the fields empty on save
Was kinda able to bypass the issue by having this in the Edit class:
protected function handleRecordUpdate(Model $record, array $data): Model
{
if (empty($data['income']))
$data['income'] = $record->income;

$record->update($data);

return $record;
}
protected function handleRecordUpdate(Model $record, array $data): Model
{
if (empty($data['income']))
$data['income'] = $record->income;

$record->update($data);

return $record;
}
Unsure if this is the proper way to deal with this tho
7 replies