Summarize Sum of a calculated field
Hi! I'm trying to show the sum of a calculated attribute.
I have a Transaction model which has many Products. The pivot table has the quantity and the unit price for the product.
So i have the attribute amount which is calculated and appended to the transaction.
I can display the amount on my table with TextColumn('amount'), but when i try to add the summary i get a error that transactions.amount is not a field in the DB.
So my question is how do i make it use the eloquent model instead of a DB query?
I have a Transaction model which has many Products. The pivot table has the quantity and the unit price for the product.
So i have the attribute amount which is calculated and appended to the transaction.
I can display the amount on my table with TextColumn('amount'), but when i try to add the summary i get a error that transactions.amount is not a field in the DB.
So my question is how do i make it use the eloquent model instead of a DB query?