Custom Query Returns getTableRecordKey()
I have been trying to make the following data display using table widgets . as an example
1. Please note that each line of is actually different customer , i just need to display the Product Name and Total Sales of each product.
2. Link that i have reffered to: https://github.com/filamentphp/filament/discussions/3182 & https://stackoverflow.com/questions/24887708/laravel-eloquent-sum-with-groupby
Product Name | Price
Product 1 | 500
Product 1 | 300
Product 1 | 200
Product 2 | 250
Product 2 | 300
Instead of price should just show a total of sales on each product like follow:
Product 1 | 1,000
Product 2 | 550
Here are some code that i have tried:
1. Please note that each line of is actually different customer , i just need to display the Product Name and Total Sales of each product.
2. Link that i have reffered to: https://github.com/filamentphp/filament/discussions/3182 & https://stackoverflow.com/questions/24887708/laravel-eloquent-sum-with-groupby
Product Name | Price
Product 1 | 500
Product 1 | 300
Product 1 | 200
Product 2 | 250
Product 2 | 300
Instead of price should just show a total of sales on each product like follow:
Product 1 | 1,000
Product 2 | 550
Here are some code that i have tried:

GitHub
Just updated Filament forms & table builder to latest version, and one of my dashboard doesn't work anymore. I believe the problem is because this particular dashboard shows aggregated repo...
Stack Overflow
Need eloquent/fluent query to get sum with groupBy function.
So far I have tried:
$this->data['no_of_pages'] = Document::sum('no_of_pages')
->groupBy('
So far I have tried:
$this->data['no_of_pages'] = Document::sum('no_of_pages')
->groupBy('
