© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•4mo ago•
4 replies
Harvey

Repeater: TextInput action always returning last record in Model $record

I have an action in a repeater that need access to the current repeater entry:
Repeater::make('test')
  ->schema([
      Hidden::make('id'),
      TextInput::make('value')
          ->hintAction(
              Action::make('display_value')
                  ->schema([
                      TextInput::make('new_amount')
                          ->required()
                          ->numeric()
                          ->minValue(0),
                  ])
                  ->action(function (Get $get) {
                      ray($get('id'), $get('value'));
                  }),
          ),
  ]),
Repeater::make('test')
  ->schema([
      Hidden::make('id'),
      TextInput::make('value')
          ->hintAction(
              Action::make('display_value')
                  ->schema([
                      TextInput::make('new_amount')
                          ->required()
                          ->numeric()
                          ->minValue(0),
                  ])
                  ->action(function (Get $get) {
                      ray($get('id'), $get('value'));
                  }),
          ),
  ]),


In my form I also add the following to put very basic test data in into the form:
protected function fillForm(): void
{
    parent::fillForm();

    $this->form->fill([
        'test' => [
            [
                'id' => 1,
                'value' => 100,
            ],
            [
                'id' => 2,
                'value' => 200,
            ]
        ]
    ]);
}
protected function fillForm(): void
{
    parent::fillForm();

    $this->form->fill([
        'test' => [
            [
                'id' => 1,
                'value' => 100,
            ],
            [
                'id' => 2,
                'value' => 200,
            ]
        ]
    ]);
}


Trying
$get('id')
$get('id')
returns the value of the last row
2
2
when it should be
1
1
.

Similar thing happens when I try to use
->relationship
->relationship
and get the current
Model $record
Model $record
.

Any ideas?
image.png
Solution
->hintAction(fn (Get $get): Action => Action::make('display_value')
    ->schema([
        TextInput::make('new_amount'),
    ])
    ->action(function (array $data) use ($get) {
        ray($get('id'), $get('value'), $data);
    }),
)
->hintAction(fn (Get $get): Action => Action::make('display_value')
    ->schema([
        TextInput::make('new_amount'),
    ])
    ->action(function (array $data) use ($get) {
        ray($get('id'), $get('value'), $data);
    }),
)
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

Table Action always the same record
FilamentFFilament / ❓┊help
2y ago
How to get record model in ViewRecord action?
FilamentFFilament / ❓┊help
3y ago
Action Of TextInput
FilamentFFilament / ❓┊help
2y ago
Returning Action in renderHook
FilamentFFilament / ❓┊help
8mo ago