F
Filament12mo ago
Phuc Le

Count selected records in Table Builder Bulk Action form

This is my code:
BulkAction::make('action')
->icon('heroicon-o-cog-6-tooth')
->deselectRecordsAfterCompletion()
->form(function (Collection $records) {
return [
Placeholder::make('Cost Breakdown')
->content('Selected: ' . number_format($records->count()))
];
}),
BulkAction::make('action')
->icon('heroicon-o-cog-6-tooth')
->deselectRecordsAfterCompletion()
->form(function (Collection $records) {
return [
Placeholder::make('Cost Breakdown')
->content('Selected: ' . number_format($records->count()))
];
}),
This will count the total of selected records and show it in the placeholder. However, if I close the modal and select one more record, the count does not change. It seems that Filament caches the modal content in subsequent requests. How can I get the fresh count data every time the modal opens?
0 Replies
No replies yetBe the first to reply to this messageJoin
Want results from more Discord servers?
Add your server