© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•2y ago•
3 replies
Kyle

How do I get the index of the current TextInput inside a simple Repeater?

I have a simple repeater, inside it is a TextInput. I just want to get the index of the current TextInput so that I can show it as the prefix. Maybe something like,

Repeater::make('scores')
  ->simple(
    TextInput::make('score')
      ->prefix(fn ($index) => $index + 1)
      ->required()
  )
Repeater::make('scores')
  ->simple(
    TextInput::make('score')
      ->prefix(fn ($index) => $index + 1)
      ->required()
  )

I tried my best to look everywhere on how I can do this but I just can't find an answer.

I would be really grateful if anyone can give me hints to this... If it's impossible, please tell me so that I can try to find another way.

Thank you very much in advance.
Filament banner
FilamentJoin
A powerful open source UI framework for Laravel • Build and ship admin panels & apps fast with Livewire
20,307Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Get the index of current repeater item
FilamentFFilament / ❓┊help
12mo ago
Get the index of a repeater?
FilamentFFilament / ❓┊help
17mo ago
Get Index of Repeater
FilamentFFilament / ❓┊help
14mo ago