DimZeta
DimZeta
FFilament
Created by DimZeta on 11/28/2024 in #❓┊help
Select same value multiple times
Hello guys, I'm new with Filament, and i'm trying to make a field named "retreats". This is an array of strings attribute, which can contain values from a predefined list. I'd like to have a kind of "TagsInput" field, with suggestions. But as soon as I select a value, I cannot select it again.
Forms\Components\TagsInput::make('retreat')
->suggestions(CardEnergy::all()->mapWithKeys(fn ($energy) => [$energy->id => Str::ucfirst($energy->value)])->toArray())
,
Forms\Components\TagsInput::make('retreat')
->suggestions(CardEnergy::all()->mapWithKeys(fn ($energy) => [$energy->id => Str::ucfirst($energy->value)])->toArray())
,
Because I don't want insert some custom values, I also tried with a Select, but same result: I can't select the same value:
Forms\Components\Select::make('retreat')
->multiple()
->options(CardEnergy::all()->mapWithKeys(fn ($energy) => [$energy->id => Str::ucfirst($energy->value)])->toArray())
,
Forms\Components\Select::make('retreat')
->multiple()
->options(CardEnergy::all()->mapWithKeys(fn ($energy) => [$energy->id => Str::ucfirst($energy->value)])->toArray())
,
Anyone has an idea to do that? Thank you!
9 replies