Total Row
Basic usage
If the value of a column field is a number and it needs to be displayed at the bottom of the table after statistics, you can use the following method.
Call the totalRow()
method after the corresponding field.
Parameters
After calling the totalRow()
method on this column, the sum
method of Eloquent
is called by default to accumulate the value display of this column, and the totalRow()
method can accept an optional parameter if it is passed in. The parameter is a string or a number, then it will be displayed directly at the bottom of the total row, for example, the word "Total" is displayed directly under the id
column:
If you want to change the display style of a total row, you can modify it by passing in an anonymous function:
Last updated