© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•5mo ago•
4 replies
Adrian A

Filament Action: Select field value missing from $data when using multiple()

Hi everyone,

I’m running into an issue with a Filament Action form.

I have a Select field inside the action. When the Select is set to multiple, the selected values do not appear in the $data array after submitting. However, if I remove ->multiple(), the value is included in $data as expected.

The TextInput fields in the same form work fine and their values are present in $data.

Here’s what I mean:

With ->multiple() enabled: $data does not contain the select field.

Without ->multiple(): the value is included correctly in $data.

I dumped the $data after submission and here’s the result (screenshot attached):

this is the code:

Action::make('AddStudent')
    ->form([
    Select::make('student_id')
      ->label('Select Student')
      ->relationship(
         name: 'students',
         titleAttribute: 'name',
          modifyQueryUsing: fn($query) => $query->where('role', 'student')
      )
      ->searchable()
      ->preload()
      ->multiple()
      ->required(),
TextInput::make('enrolled_at')
      ->required()
      ])
      ->action(function (array $data) {
          dd($data);
      })
Action::make('AddStudent')
    ->form([
    Select::make('student_id')
      ->label('Select Student')
      ->relationship(
         name: 'students',
         titleAttribute: 'name',
          modifyQueryUsing: fn($query) => $query->where('role', 'student')
      )
      ->searchable()
      ->preload()
      ->multiple()
      ->required(),
TextInput::make('enrolled_at')
      ->required()
      ])
      ->action(function (array $data) {
          dd($data);
      })


My question: What am I missing? Is there something special I need to configure for Select::make()->multiple() so that its data is included in $data?

Thanks in advance!
image.png
Solution
the relationship function is the culprit, I think they handle the saving elsewhere, try removing it and add some hardcoded options and they should appear in the dd
Jump to solution
Filament banner
FilamentJoin
A powerful open source UI framework for Laravel • Build and ship admin panels & apps fast with Livewire
20,307Members
Resources
Was this page helpful?

Similar Threads

Recent Announcements

Similar Threads

Action refresh Select field value
FilamentFFilament / ❓┊help
3y ago
format state of select input field using multiple data from other models
FilamentFFilament / ❓┊help
3y ago
Select value when using allowHtml
FilamentFFilament / ❓┊help
3y ago
Select field default value
FilamentFFilament / ❓┊help
3y ago