Getting started
Filament comes with a “stats overview” widget template, which you can use to display a number of different stats in a single widget, without needing to write a custom view. Start by creating a widget with the command:Card instances from the getCards() method:
Card descriptions and icons
You may add adescription() to provide additional information, along with a descriptionIcon():
Card colors
You may also give cards acolor() (primary, success, warning or danger):
Card extra HTML attributes
You may also pass extra HTML attributes to cards usingextraAttributes():
Card charts
You may also add or chain achart() to each card to provide historical data. The chart() method accepts an array of data points to plot:
Live updating (polling)
By default, stats overview widgets refresh their data every 5 seconds. To customize this, you may override the$pollingInterval property on the class to a new interval: