default value in custom page
Hi , how to add default value for textInput in custom page ? I try to use afterStateHydrated still not working.
23 Replies
TextInput::make('code')->default("Some value")
?@chesters666 this code not wrk in custom page
->placeholder('value')
but ->default needs to work to
->placeholder('value') work , but not ->dafault()
ah alright we learned something new π probaly because it won't work on the textInput but only on textEntry , so thats why placeholder does work
yes, but I need work in textInput with default value π
TextInput::make('code' ?? 'Default value')
this should work
i guess
The default is working for me i think there is a problem with your class
still not work
@Shades.
alrighttttt let me look into it
Why don't you use from your BranchResource the create?
BranchResource use in Edit Branch .
and Add Budget Planner is custom page .
to manage this sidebar I use this package : https://github.com/aymanalhattami/filament-page-with-sidebar-project
GitHub
GitHub - aymanalhattami/filament-page-with-sidebar-project
Contribute to aymanalhattami/filament-page-with-sidebar-project development by creating an account on GitHub.
this my branchREsource
this should work fine for your navigation
i will look for you what the problem is
ahh nevermind xD
I don't see why it's not working, does it has the line under TextInput still if you delete the ?? 'default value'
this is the complete code
Can you try this
\Filament\Forms\Components\Textarea::make('code')->default("Something")
?@ChesterS still not work .
@Dan Harrin please can you help me ?
or this is a bug ?
no bug, you just havent read the "Adding a form to a Livewire component" docs. you are missing
$this->form->fill()
in mount().
also, read the #β
βrules, you should not be @ing anyone for help.