F
Filament12mo ago
thyk123

count how many item on repeater

How to count how many item that already create to user in laravel filament? Please help me! Thank you very much!
Solution:
```php Placeholder::make('repeater_count') ->content(fn (Get $get): string => count($get('repeater'))), Repeater::make('repeater') ->schema([...
Jump to solution
6 Replies
mvenghaus
mvenghaus12mo ago
you can use formatStateUsing with $get
thyk123
thyk123OP12mo ago
Hi! Thank you again for responding my question! could you give me an example, i really appriciate that!
Solution
LeandroFerreira
LeandroFerreira12mo ago
Placeholder::make('repeater_count')
->content(fn (Get $get): string => count($get('repeater'))),
Repeater::make('repeater')
->schema([
TextInput::make('field')
])
Placeholder::make('repeater_count')
->content(fn (Get $get): string => count($get('repeater'))),
Repeater::make('repeater')
->schema([
TextInput::make('field')
])
?
mvenghaus
mvenghaus12mo ago
string -> int
thyk123
thyk123OP12mo ago
Thank you sou much @laradev @mvenghaus, you people are so nice! May your day bless! one more! question, where can i learn craft function like that? i still dont understand to make the function like that @mvenghaus @Leandro Ferreira

Did you find this page helpful?