feat: implement services overview page with service status cards and counts
This commit is contained in:
33
app/Admin/Clusters/Services/Pages/ServicesOverview.php
Normal file
33
app/Admin/Clusters/Services/Pages/ServicesOverview.php
Normal file
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
namespace App\Admin\Clusters\Services\Pages;
|
||||
|
||||
use App\Admin\Clusters\Services;
|
||||
use App\Models\Service;
|
||||
use Filament\Pages\Page;
|
||||
|
||||
class ServicesOverview extends Page
|
||||
{
|
||||
protected static ?string $navigationIcon = 'ri-dashboard-line';
|
||||
|
||||
protected static ?string $activeNavigationIcon = 'ri-dashboard-fill';
|
||||
|
||||
protected static ?string $navigationLabel = 'Overview';
|
||||
|
||||
protected static ?int $navigationSort = -1;
|
||||
|
||||
protected static ?string $cluster = Services::class;
|
||||
|
||||
protected static string $view = 'admin.clusters.services.pages.services-overview';
|
||||
|
||||
public function getViewData(): array
|
||||
{
|
||||
return [
|
||||
'activeCount' => Service::where('status', 'active')->count(),
|
||||
'pendingCount' => Service::where('status', 'pending')->count(),
|
||||
'suspendedCount' => Service::where('status', 'suspended')->count(),
|
||||
'cancelledCount' => Service::where('status', 'cancelled')->count(),
|
||||
'totalCount' => Service::count(),
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user