34 lines
1013 B
PHP
34 lines
1013 B
PHP
<?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(),
|
|
];
|
|
}
|
|
}
|