From a04e96cc2269fa4c7d718e0ee13b77c3858b3c20 Mon Sep 17 00:00:00 2001 From: Mr Sleeps Date: Mon, 29 Jun 2026 19:15:22 +0100 Subject: [PATCH] Updates --- .../Resources/Tables/DomainsTable.php | 94 ++++++++----------- 1 file changed, 37 insertions(+), 57 deletions(-) diff --git a/src/Filament/Resources/Tables/DomainsTable.php b/src/Filament/Resources/Tables/DomainsTable.php index a979fba9..3120ac24 100644 --- a/src/Filament/Resources/Tables/DomainsTable.php +++ b/src/Filament/Resources/Tables/DomainsTable.php @@ -53,65 +53,45 @@ class DomainsTable } }), -IconColumn::make('dmarc_status') - ->label('DMARC') - ->getStateUsing(function ($record): string { - $dmarc = $record->dmarcCheck; - - if (!$dmarc) { - return 'not_checked'; - } - - return $dmarc->valid ? 'valid' : 'invalid'; - }) - ->icon(function ($state): string { - return match($state) { - 'valid' => 'heroicon-o-shield-check', - 'invalid' => 'heroicon-o-exclamation-triangle', - 'not_checked' => 'heroicon-o-exclamation-triangle', // or 'heroicon-o-question-mark-circle' - }; - }) - ->color(function ($state): string { - return match($state) { - 'valid' => 'success', - 'invalid' => 'danger', - 'not_checked' => 'warning', - }; - }) - ->tooltip(function ($record): string { - $dmarc = $record->dmarcCheck; - - if (!$dmarc) { - return 'DMARC not checked yet'; - } - - if ($dmarc->valid) { - return "DMARC valid (Policy: {$dmarc->getPolicyLabel()})"; - } - - return "DMARC invalid: {$dmarc->error_message}"; - }), + IconColumn::make('dmarc_status') + ->label('DMARC') + ->alignCenter() + ->getStateUsing(function ($record): string { + $dmarc = $record->dmarcCheck; + + if (!$dmarc) { + return 'not_checked'; + } + + return $dmarc->valid ? 'valid' : 'invalid'; + }) + ->icon(function ($state): string { + return match($state) { + 'valid' => 'heroicon-o-shield-check', + 'invalid' => 'heroicon-o-exclamation-triangle', + 'not_checked' => 'heroicon-o-exclamation-triangle', // or 'heroicon-o-question-mark-circle' + }; + }) + ->color(function ($state): string { + return match($state) { + 'valid' => 'success', + 'invalid' => 'danger', + 'not_checked' => 'warning', + }; + }) + ->tooltip(function ($record): string { + $dmarc = $record->dmarcCheck; + + if (!$dmarc) { + return 'DMARC not checked yet'; + } + + if ($dmarc->valid) { + return "DMARC valid (Policy: {$dmarc->getPolicyLabel()})"; + } - IconColumn::make('dmarccheck.valid') - ->label('DMARC') - ->boolean() - ->trueIcon('heroicon-o-shield-check') - ->falseIcon('heroicon-o-exclamation-triangle') - ->trueColor('success') - ->falseColor('danger') - ->tooltip(function ($record): string { - $dmarc = $record->dmarcCheck; - - if (!$dmarc || $dmarc == NULL) { - return 'DMARC not checked yet'; - } - - if ($dmarc->valid) { - return "DMARC valid (Policy: {$dmarc->getPolicyLabel()})"; - } else { return "DMARC invalid: {$dmarc->error_message}"; - } - }), + }), ]) ->filters([ SelectFilter::make('enabled')