© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•3y ago•
1 reply
NoxyArg

Repeater sum Items and quantities

I have a problem, I have a repeater and I want to calculate the items and quantities, create a placeholder inside the repeater with the subtotal of the item, and a placeholder outside the repeater to calculate all the added items * quantities, until then it works perfectly, the problem I have is if I add more quantity, it doesn't update the total that is outside the repeater, any ideas?



Repeater::make('invoiceItems')...
TextInput::make('article_quantity')...
TextInput::make('article_price')...


Placeholder::make('subtotal')
->content(function ($get) {
$ar_price = intval($get('article_price'));
$ar_qty = intval($get('article_quantity'));
$sub = $ar_price * $ar_qty;
return '$' . number_format($sub, 2);
}),

Outside the repeater ......

Placeholder::make('Total')
->content(function ($get) {
return collect($get('invoiceItems'))
->pluck('subtotal')
->sum();
}),
image.png
image.png
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

Repeater : Grouping items
FilamentFFilament / ❓┊help
2y ago
Reordering repeater items
FilamentFFilament / ❓┊help
2y ago
Repeater default items
FilamentFFilament / ❓┊help
3y ago
Add X repeater items
FilamentFFilament / ❓┊help
2y ago