Skip to content

Commit

Permalink
pint
Browse files Browse the repository at this point in the history
  • Loading branch information
arduinomaster22 committed Jan 11, 2025
1 parent ad4f3c4 commit aab5fbc
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions src/Resources/SuppressionResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,7 @@
use Filament\Tables\Table;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Support\Facades\Artisan;
use Illuminate\Support\Facades\Mail;
use Vormkracht10\FilamentMails\Resources\SuppressionResource\Pages\ListSuppressions;
use Vormkracht10\FilamentMails\Resources\SuppressionResource\Pages\ViewSuppression;
use Vormkracht10\Mails\Enums\EventType;
use Vormkracht10\Mails\Models\MailEvent;

Expand Down Expand Up @@ -77,26 +75,26 @@ public static function getEloquentQuery(): Builder
public static function table(Table $table): Table
{
return $table
->headerActions([Action::make('clean')->action(fn() => Artisan::call('app:clean-unsupressions'))])
->headerActions([Action::make('clean')->action(fn () => Artisan::call('app:clean-unsupressions'))])
->defaultSort('occurred_at', 'desc')
->columns([
Tables\Columns\TextColumn::make('mail.to')
->label(__('Email address'))
->formatStateUsing(fn(MailEvent $record) => key($record->mail->to))
->formatStateUsing(fn (MailEvent $record) => key($record->mail->to))
->searchable(['to']),

Tables\Columns\TextColumn::make('occurred_at')
->badge()
->label(__('Suppressed At'))
->dateTime('d-m-Y H:i')
->since()
->tooltip(fn(MailEvent $record) => $record->occurred_at->format('d-m-Y H:i'))
->tooltip(fn (MailEvent $record) => $record->occurred_at->format('d-m-Y H:i'))
->sortable()
->searchable(),
])
->actions([
Tables\Actions\Action::make('unsupress')
->action(fn(MailEvent $record) => $record->unSuppress()),
->action(fn (MailEvent $record) => $record->unSuppress()),

Check failure on line 97 in src/Resources/SuppressionResource.php

View workflow job for this annotation

GitHub Actions / phpstan

Call to an undefined method Vormkracht10\Mails\Models\MailEvent::unSuppress().

Tables\Actions\ViewAction::make()
->url(null)
Expand All @@ -105,14 +103,14 @@ public static function table(Table $table): Table
->label(__('View'))
->hiddenLabel()
->tooltip(__('View'))
->infolist(fn(Infolist $infolist) => EventResource::infolist($infolist)),
->infolist(fn (Infolist $infolist) => EventResource::infolist($infolist)),
]);
}

public static function getPages(): array
{
return [
'index' => ListSuppressions::route('/')
'index' => ListSuppressions::route('/'),
];
}
}

0 comments on commit aab5fbc

Please sign in to comment.