© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•3y ago•
6 replies
Panda

Is it possible to modify the aggregation column query?

I am currently loading the sum of
amount
amount
field from
transactions
transactions
relation on my
CoinsPack
CoinsPack
model using the following code. The
Transaction
Transaction
has a
status
status
field which can be either
pending
pending
,
cancelled
cancelled
and
successful
successful
and I want the sum of
amount
amount
column for only successful transactions.

Tables\Columns\TextColumn::make('transactions_sum_amount')
    ->sum('transactions', 'amount')
    ->money('USD')
    ->label('Sales')
    ->placeholder('No sales'),
Tables\Columns\TextColumn::make('transactions_sum_amount')
    ->sum('transactions', 'amount')
    ->money('USD')
    ->label('Sales')
    ->placeholder('No sales'),
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

Conditionally modify query based on column visibility
FilamentFFilament / ❓┊help
3y ago
Is it possible to make the toggle column dropdown scrollable?
FilamentFFilament / ❓┊help
2y ago
Is it possible to modify the SelectFilter instance in a service provider?
FilamentFFilament / ❓┊help
3y ago
Is it possible to modify state of KeyValue before filling?
FilamentFFilament / ❓┊help
3y ago