Counter
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 |
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:1']
])
For example, for | Optional |