FilamentF
Filamentβ€’2y ago
Calden

Concat two form fields with multiple select relationship

Hey !

In a resource file, i have this

public static function form(Form $form): Form
    {
        return $form
            ->schema([
                Forms\Components\Select::make('teams')
                    ->multiple()
                    ->relationship('teams', 'name')
                    ->preload()
                    ->required(),
                Forms\Components\TextInput::make('group')
                    ->maxLength(255),
                Forms\Components\TextInput::make('name'),


in the name field, i'd like to concat all selected names of team selected in the multiselect teams field and concat this with the group textinput field

I dont understand how to get teams names with afterStateUpdated, i only get ids of teams.

Any help ? πŸ™‚
Was this page helpful?