Money column
MoneyColumn is a numeric column rendered as currency. Symbol placement and the number of decimal
places follow the viewer’s locale and the currency itself, so you feed it a plain amount. It is
sortable and filters as a number.
MoneyColumn::make('total')->label('Total')->currency('EUR')->sortable();MoneyColumn::make('refunded')->label('Refunded')->currencyField('currency');- actionsLabel:"Actions"
- bulkActions:[]
- data:[{"currency":"USD","number":"INV-1001","refunded":"0.00","total":"189.00"},{"currency":"GBP","number":"INV-1002","refunded":"49.50","total":"49.50"}]
- emptyLabel:"No results"
- endpoint:null
- filters:[]
- layout:null
- lazy:null
- pagination:{"currentPage":null,"from":1,"hasMore":false,"lastPage":null,"mode":"none","nextPage":null,"perPage":null,"to":2,"total":2}
- resizableColumns:null
- resizeIndicator:false
- state:{"filters":[],"page":1,"perPage":25,"sorts":[],"tableFilters":[]}
- striped:null
- badge:null
- copyable:false
- date:null
- link:null
- multiple:null
- currency:"EUR"
- currencyField:null
- maximumFractionDigits:null
- minimumFractionDigits:null
- currency:null
- currencyField:"currency"
- maximumFractionDigits:null
- minimumFractionDigits:null
->currency('EUR')fixes one currency for the whole column.->currencyField('currency')reads each row’s currency code from another field — for a table whose rows are in different currencies.
MoneyColumn::make('price')->currency('USD');MoneyColumn::make('amount')->currencyField('currency_code');Like every numeric column, ->decimals($min, $max?) overrides the fraction digits when you need to
depart from the currency’s default.