filters['startDate'] ?? null; $endDate = $this->filters['endDate'] ?? null; $certified = Journalist::whereNotNull('ukw_certificate') ->where('ukw_certificate', '!=', '') ->when($startDate, fn ($q) => $q->whereDate('created_at', '>=', $startDate)) ->when($endDate, fn ($q) => $q->whereDate('created_at', '<=', $endDate)) ->count(); $notCertified = Journalist::where(function ($query) { $query->whereNull('ukw_certificate') ->orWhere('ukw_certificate', ''); }) ->when($startDate, fn ($q) => $q->whereDate('created_at', '>=', $startDate)) ->when($endDate, fn ($q) => $q->whereDate('created_at', '<=', $endDate)) ->count(); return [ 'datasets' => [ [ 'label' => 'Jumlah Jurnalis', 'data' => [$certified, $notCertified], 'backgroundColor' => ['#10B981', '#EF4444'], ], ], 'labels' => ['Sudah Sertifikasi UKW', 'Belum Sertifikasi UKW'], ]; } protected function getType(): string { return 'doughnut'; } }