rapolasgruzdys
rapolasgruzdys
FFilament
Created by rapolasgruzdys on 9/5/2023 in #❓┊help
Unable to set a default value for \Filament\Forms\Components\Select
In case anybody encounters a similar situation - I solved this with the formatStateUsing method. Thanks for much for the help again
12 replies
FFilament
Created by rapolasgruzdys on 9/5/2023 in #❓┊help
Unable to set a default value for \Filament\Forms\Components\Select
That makes sense, thank you for your time. Just for context, I'm using the event sourcing architecture so the default CRUD operations don't cut it here, so I was looking to format the state in my own way, instead of overriding the update process in multiple places. I'll try to format the state as you've suggested or override a couple of methods in a worst-case scenario
12 replies
FFilament
Created by rapolasgruzdys on 9/5/2023 in #❓┊help
Unable to set a default value for \Filament\Forms\Components\Select
Wow that's so weird, it's indeed working with the Create page. Thanks for the help @leandro_ferreira ! Any idea why it wouldn't work in the Edit page?
12 replies
FFilament
Created by rapolasgruzdys on 9/5/2023 in #❓┊help
Unable to set a default value for \Filament\Forms\Components\Select
I'll try it on the Create page. I've been using it on the Edit page at the moment and it doesn't work 🤔
12 replies
FFilament
Created by rapolasgruzdys on 9/5/2023 in #❓┊help
Unable to set a default value for \Filament\Forms\Components\Select
I'm using admin panel and it's just a regular page - nothing custom. I haven't even seen any examples online, showing how to preselect options. So it's weird. I have a resource, it has a defined form. In the form, I call Select::make('test')->multiple()->options(['foo' => 'FOO', 'bar' => 'BAR']) So how do I make it preselect foo or bar ? Assuming these options are not from a relationship
12 replies