diff --git a/app/Filament/Resources/Manage/Cooperations/Tables/CooperationsTable.php b/app/Filament/Resources/Manage/Cooperations/Tables/CooperationsTable.php index a30a641..10bd11a 100644 --- a/app/Filament/Resources/Manage/Cooperations/Tables/CooperationsTable.php +++ b/app/Filament/Resources/Manage/Cooperations/Tables/CooperationsTable.php @@ -26,6 +26,7 @@ use Filament\Schemas\Components\Utilities\Get; use Filament\Support\Icons\Heroicon; use Filament\Tables\Columns\TextColumn; +use Filament\Tables\Enums\FiltersLayout; use Filament\Tables\Filters\Filter; use Filament\Tables\Filters\SelectFilter; use Filament\Tables\Filters\TrashedFilter; @@ -178,12 +179,14 @@ public static function configure(Table $table): Table 'year' => 'Tahun', 'range' => 'Rentang Tanggal', ]) - ->default('date') - ->live(), + ->live() + ->native(false), DatePicker::make('specific_date') ->label('Tanggal') - ->visible(fn (Get $get) => $get('date_type') === 'date'), + ->visible(fn (Get $get) => $get('date_type') === 'date') + ->native(false) + ->displayFormat('l, d F Y'), Select::make('month') ->label('Bulan') @@ -201,7 +204,8 @@ public static function configure(Table $table): Table 11 => 'November', 12 => 'Desember', ]) - ->visible(fn (Get $get) => $get('date_type') === 'month'), + ->visible(fn (Get $get) => $get('date_type') === 'month') + ->native(false), Select::make('year') ->label('Tahun') @@ -210,15 +214,20 @@ public static function configure(Table $table): Table return array_combine($years, $years); }) - ->visible(fn (Get $get) => in_array($get('date_type'), ['month', 'year'])), + ->visible(fn (Get $get) => in_array($get('date_type'), ['month', 'year'])) + ->native(false), DatePicker::make('start_date') ->label('Mulai Tanggal') - ->visible(fn (Get $get) => $get('date_type') === 'range'), + ->visible(fn (Get $get) => $get('date_type') === 'range') + ->native(false) + ->displayFormat('l, d F Y'), DatePicker::make('end_date') ->label('Sampai Tanggal') - ->visible(fn (Get $get) => $get('date_type') === 'range'), + ->visible(fn (Get $get) => $get('date_type') === 'range') + ->native(false) + ->displayFormat('l, d F Y'), ]) ->query(function (Builder $query, array $data): Builder { $type = $data['date_type'] ?? null; @@ -240,7 +249,8 @@ public static function configure(Table $table): Table return $query; }), - ]) + ], FiltersLayout::AboveContentCollapsible) + ->filtersFormColumns(3) ->recordActions([ ViewAction::make(), diff --git a/app/Filament/Resources/Monitoring/ContentRecaps/Tables/ContentRecapsTable.php b/app/Filament/Resources/Monitoring/ContentRecaps/Tables/ContentRecapsTable.php index 7b4fc4a..c402d8e 100644 --- a/app/Filament/Resources/Monitoring/ContentRecaps/Tables/ContentRecapsTable.php +++ b/app/Filament/Resources/Monitoring/ContentRecaps/Tables/ContentRecapsTable.php @@ -108,7 +108,6 @@ public static function configure(Table $table): Table 'year' => 'Tahun', 'range' => 'Rentang Tanggal', ]) - ->default('date') ->live() ->native(false), diff --git a/app/Filament/Resources/Monitoring/IssueManagements/Tables/IssueManagementTable.php b/app/Filament/Resources/Monitoring/IssueManagements/Tables/IssueManagementTable.php index d517086..3404e92 100644 --- a/app/Filament/Resources/Monitoring/IssueManagements/Tables/IssueManagementTable.php +++ b/app/Filament/Resources/Monitoring/IssueManagements/Tables/IssueManagementTable.php @@ -123,7 +123,6 @@ public static function configure(Table $table): Table 'year' => 'Tahun', 'range' => 'Rentang Tanggal', ]) - ->default('date') ->live() ->native(false), diff --git a/app/Filament/Resources/Monitoring/MediaMonitorings/Tables/MediaMonitoringsTable.php b/app/Filament/Resources/Monitoring/MediaMonitorings/Tables/MediaMonitoringsTable.php index 715ad47..e41d007 100644 --- a/app/Filament/Resources/Monitoring/MediaMonitorings/Tables/MediaMonitoringsTable.php +++ b/app/Filament/Resources/Monitoring/MediaMonitorings/Tables/MediaMonitoringsTable.php @@ -135,7 +135,6 @@ public static function configure(Table $table): Table 'year' => 'Tahun', 'range' => 'Rentang Tanggal', ]) - ->default('date') ->live() ->native(false), diff --git a/app/Filament/Widgets/OverviewStats.php b/app/Filament/Widgets/OverviewStats.php index c83d515..d88e8f1 100644 --- a/app/Filament/Widgets/OverviewStats.php +++ b/app/Filament/Widgets/OverviewStats.php @@ -27,19 +27,19 @@ protected function getStats(): array $startDate = $this->filters['startDate'] ?? null; $endDate = $this->filters['endDate'] ?? null; - $totalJournalists = Journalist::when($startDate, fn($q) => $q->whereDate('created_at', '>=', $startDate)) - ->when($endDate, fn($q) => $q->whereDate('created_at', '<=', $endDate)) + $totalJournalists = Journalist::when($startDate, fn ($q) => $q->whereDate('created_at', '>=', $startDate)) + ->when($endDate, fn ($q) => $q->whereDate('created_at', '<=', $endDate)) ->count(); - $totalMedia = PartnerMedia::when($startDate, fn($q) => $q->whereDate('created_at', '>=', $startDate)) - ->when($endDate, fn($q) => $q->whereDate('created_at', '<=', $endDate)) + $totalMedia = PartnerMedia::when($startDate, fn ($q) => $q->whereDate('created_at', '>=', $startDate)) + ->when($endDate, fn ($q) => $q->whereDate('created_at', '<=', $endDate)) ->count(); $average = $totalMedia > 0 ? round($totalJournalists / $totalMedia, 1) : 0; return [ - Stat::make('Total Perusahaan', Company::when($startDate, fn($q) => $q->whereDate('created_at', '>=', $startDate)) - ->when($endDate, fn($q) => $q->whereDate('created_at', '<=', $endDate)) + Stat::make('Total Perusahaan', Company::when($startDate, fn ($q) => $q->whereDate('created_at', '>=', $startDate)) + ->when($endDate, fn ($q) => $q->whereDate('created_at', '<=', $endDate)) ->count()) ->description('Perusahaan terdaftar') ->descriptionIcon(Heroicon::BuildingOffice2) @@ -48,38 +48,38 @@ protected function getStats(): array Stat::make('Media Terverifikasi', PartnerMedia::whereHas('company.verificationRequest', function ($q) { $q->approved(); }) - ->when($startDate, fn($q) => $q->whereDate('created_at', '>=', $startDate)) - ->when($endDate, fn($q) => $q->whereDate('created_at', '<=', $endDate)) + ->when($startDate, fn ($q) => $q->whereDate('created_at', '>=', $startDate)) + ->when($endDate, fn ($q) => $q->whereDate('created_at', '<=', $endDate)) ->count()) ->description('Media aktif') ->descriptionIcon(Heroicon::CheckBadge) ->color('success'), - Stat::make('Total Jurnalis', Journalist::when($startDate, fn($q) => $q->whereDate('created_at', '>=', $startDate)) - ->when($endDate, fn($q) => $q->whereDate('created_at', '<=', $endDate)) + Stat::make('Total Jurnalis', Journalist::when($startDate, fn ($q) => $q->whereDate('created_at', '>=', $startDate)) + ->when($endDate, fn ($q) => $q->whereDate('created_at', '<=', $endDate)) ->count()) ->description('Jurnalis terdaftar') ->descriptionIcon(Heroicon::Identification) ->color('info'), Stat::make('Antrean Verifikasi', VerificationRequest::pending() - ->when($startDate, fn($q) => $q->whereDate('created_at', '>=', $startDate)) - ->when($endDate, fn($q) => $q->whereDate('created_at', '<=', $endDate)) + ->when($startDate, fn ($q) => $q->whereDate('created_at', '>=', $startDate)) + ->when($endDate, fn ($q) => $q->whereDate('created_at', '<=', $endDate)) ->count()) ->description('Butuh tindakan') ->descriptionIcon(Heroicon::PencilSquare) ->color('warning'), Stat::make('Antrean Perubahan', DataChangeRequest::pending() - ->when($startDate, fn($q) => $q->whereDate('created_at', '>=', $startDate)) - ->when($endDate, fn($q) => $q->whereDate('created_at', '<=', $endDate)) + ->when($startDate, fn ($q) => $q->whereDate('created_at', '>=', $startDate)) + ->when($endDate, fn ($q) => $q->whereDate('created_at', '<=', $endDate)) ->count()) ->description('Perubahan data') ->descriptionIcon(Heroicon::DocumentText) ->color('warning'), - Stat::make('Total Pengunjung', Visitor::when($startDate, fn($q) => $q->whereDate('date', '>=', $startDate)) - ->when($endDate, fn($q) => $q->whereDate('date', '<=', $endDate)) + Stat::make('Total Pengunjung', Visitor::when($startDate, fn ($q) => $q->whereDate('date', '>=', $startDate)) + ->when($endDate, fn ($q) => $q->whereDate('date', '<=', $endDate)) ->count()) ->description('Total traffic') ->descriptionIcon(Heroicon::ChartBar)