-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathStatsOverview.php
36 lines (30 loc) · 1002 Bytes
/
StatsOverview.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
<?php
namespace App\Filament\App\Widgets;
use App\Models\Appointment;
use App\Models\Post;
use App\Models\Product;
use Filament\Widgets\StatsOverviewWidget as BaseWidget;
use Filament\Widgets\StatsOverviewWidget\Stat;
class StatsOverview extends BaseWidget
{
protected static $order = 1;
protected function getStats(): array
{
return [
Stat::make('Appointment Count', Appointment::count())
->description('Total appointments')
->descriptionIcon('heroicon-m-calendar')
->color('success'),
//Post count
Stat::make('Post Count', Post::count())
->description('Total posts')
->descriptionIcon('heroicon-s-newspaper')
->color('info'),
// products count
Stat::make('Product Count', Product::count())
->description('Total products')
->descriptionIcon('heroicon-s-shopping-cart')
->color('warning'),
];
}
}