Counter
Rendered example:

Counters do not enlarge the value or icon on hover by default. Use hoverScale() only when this extra emphasis is intentional for a specific card.
Description
This module displays count of some entity in database, selected according to the necessary criteria. For example, you can display total number of registered users or, today orders, or something else.
Configuration
To add to the page Counter module you need paste AlexKudrya\Adminix\Modules\Counter\CounterModule class instance as an argument to addModule or addModules method of AdminixPage object.
CounterModule configuration
Method | Description | |
|---|---|---|
title | Title on top of the counter
title('TOTAL USERS')
| Required |
name | Name of module, must be unique in current page.
name('total_users')
| Required |
icon | Icon class name from Bootsrap icons Example: to generate in right side of the Counter an icon
icon('bi bi-people')
| Optional |
hoverScale | Opt in to the hover animation that enlarges the counter value and icon.
hoverScale()
| Optional |
withoutHoverScale | Explicitly keep the counter static on hover. This is the default behavior and is mainly useful when configuration is composed conditionally.
withoutHoverScale()
| Optional |
dataSource | Source of data for Counter, can be an
dataSource(\App\Models\User::class)
| Required |
criteria | Database
criteria([
['is_admin', '=', false]
])
Or you can paste parameter from route:
criteria([
['user_id', '=', 'param:0']
])
For example, for | Optional |