FilamentF
Filament13mo ago
DimZeta

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())
,


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())
,


Anyone has an idea to do that?

Thank you!
Was this page helpful?