F
Filament7mo ago
Mexata

->default function inside a wizard form

Could anyone tell me why ->default() is not working at all.
Group::make([
TextInput::make('identity')
->label('Identity')
->required()
TextInput::make('web')
->label('Web Url')
->default('https://www.test.com/v1/{identity}')
->disabled()
->required(),
])
Group::make([
TextInput::make('identity')
->label('Identity')
->required()
TextInput::make('web')
->label('Web Url')
->default('https://www.test.com/v1/{identity}')
->disabled()
->required(),
])
14 Replies
LeandroFerreira
LeandroFerreira7mo ago
Are you using the panel builder or only the form builder?
toeknee
toeknee7mo ago
Are you editing or creating? Default doesn't work for editing and only on creation.
Mexata
MexataOP7mo ago
creating A form inside a wizard
LeandroFerreira
LeandroFerreira7mo ago
Is it a custom livewire component?
toeknee
toeknee7mo ago
Ensure your mount is set to form fill. But I don't think you are doing it correctly, I think you actually want:
Group::make([
TextInput::make('identity')
->label('Identity')
->live()
->afterStateUpdated(fn($state, $set) => $set('web', 'https://www.test.com/v1/' . $state))
->required()
TextInput::make('web')
->label('Web Url')
->default('https://www.test.com/v1/{identity}')
->disabled()
->required(),
])
Group::make([
TextInput::make('identity')
->label('Identity')
->live()
->afterStateUpdated(fn($state, $set) => $set('web', 'https://www.test.com/v1/' . $state))
->required()
TextInput::make('web')
->label('Web Url')
->default('https://www.test.com/v1/{identity}')
->disabled()
->required(),
])
Mexata
MexataOP7mo ago
no this sadly did not fix the issue
LeandroFerreira
LeandroFerreira7mo ago
Did you try it without disabled() ?
Mexata
MexataOP7mo ago
yes i have, this does not fix it either
LeandroFerreira
LeandroFerreira7mo ago
Please share the whole code you are trying
Mexata
MexataOP7mo ago
toeknee
toeknee7mo ago
So that's not a filament wizard/form natively, it's through a plugin, natively it works. I also suspect it's not actually mounting... is this filament onboard pro?
Mexata
MexataOP7mo ago
yes it is
toeknee
toeknee7mo ago
So raise it with Ralph in #ralphjsmit-onboarding-manager-pro
Mexata
MexataOP7mo ago
alright will do
Want results from more Discord servers?
Add your server