Level 75
You can treat the export like a report, in a report the totals are a derived column using an aggregate.
Also a previous post: https://laracasts.com/discuss/channels/laravel/laravel-excel-how-to-export-to-excel-with-formulas
2 likes
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
Hi everyone, im trying to export a model order by user id and i need to show the total amount of the items for every user
like this
user item-name amount
1 2 5
1 1 3
total 3 8
2 0 0
2 1 3
total 1 3
i cant find information on how can i do this btw i use maatwebsite laravel-excel
You can treat the export like a report, in a report the totals are a derived column using an aggregate.
Also a previous post: https://laracasts.com/discuss/channels/laravel/laravel-excel-how-to-export-to-excel-with-formulas
Please or to participate in this conversation.