© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•3y ago•
4 replies
AmauryCid

Summarize Relationship aggregate

Hi, is there a way to custom summarize a relationship sum aggregate?
Something like:

TextColumn::make('totalHours')
  ->label('Total Hours')
  ->state(fn(Model $record) => 
    $record->payroll_items_sum_reg_hours +
    $record->payroll_items_sum_ot_hours)
  ->summarize(Summarizer::make()
      ->label('Total')
      ->using(fn(Builder $query): string =>
        $query->payroll_items_sum_reg_hours +                       $query->payroll_items_sum_ot_hours)),
TextColumn::make('totalHours')
  ->label('Total Hours')
  ->state(fn(Model $record) => 
    $record->payroll_items_sum_reg_hours +
    $record->payroll_items_sum_ot_hours)
  ->summarize(Summarizer::make()
      ->label('Total')
      ->using(fn(Builder $query): string =>
        $query->payroll_items_sum_reg_hours +                       $query->payroll_items_sum_ot_hours)),


This throws a:
Undefined property: Illuminate\Database\Query\Builder::$payroll_items_sum_reg_hours
How could I access the relationship in the summarizer?
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

Summarize Relationship Column
FilamentFFilament / ❓┊help
3y ago
Calculate summarize from others summarize
FilamentFFilament / ❓┊help
2y ago
Summarize Help
FilamentFFilament / ❓┊help
2y ago
Summarize JSON
FilamentFFilament / ❓┊help
3y ago