Level 102
You can run sum on the query
MyModel::where('foo', 1)->sum('bar');
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
Say you have a column on a resource table with prices. And you want the price total in a new row at the bottom of the table.
What would be the best way to do this?
Please or to participate in this conversation.