FilamentF
Filament11mo ago
Azorky

Hidden fields not dehydrating

public static function getAccountingFields(JournalType $journalType, ?string $settingsResource = null): Fieldset
    {
        return Fieldset::make(__('resources/sales-invoices.navigation_group'))
            ->schema([
                self::getJournalSelectField($journalType, settingsResource: $settingsResource),
                self::getCostUnitSelectField(),
                self::getGeneralGLAccountField(settingsResource: $settingsResource),
            ])
            ->columns(3)
            ->visible(fn (Get $get) => $get('show_gl_account_field'));
    }


I have a couple of fields in my form in a fieldset like this. This fieldset can be toggled hidden.
When the fields are hidden, they are not properly dehydrated, while I can see that the data is present in $livewire->data:
protected function handleRecordCreation(array $data): Model
    {
        dd($data, $this->data);
//...
image.png
Was this page helpful?