diff --git a/src/Resources/SuppressionResource.php b/src/Resources/SuppressionResource.php new file mode 100644 index 0000000..592b466 --- /dev/null +++ b/src/Resources/SuppressionResource.php @@ -0,0 +1,104 @@ +recordAction('view') + ->recordUrl(null) + ->defaultSort('created_at', 'desc') + ->columns([ + Tables\Columns\TextColumn::make('mail.to') + ->label(__('Email address')) + ->formatStateUsing(fn(MailEvent $record) => key($record->mail->to)) + ->searchable(['to']), + Tables\Columns\TextColumn::make('occurred_at') + ->label(__('Suppressed At')) + ->dateTime('d-m-Y H:i') + ->since() + ->tooltip(fn(MailEvent $record) => $record->occurred_at->format('d-m-Y H:i')) + ->sortable() + ->searchable(), + ]) + ->modifyQueryUsing(fn($query) => $query->where('type', EventType::HARD_BOUNCED)) + ->filters([ + // + ]) + ->actions([ + Tables\Actions\ViewAction::make() + ->url(null) + ->modal() + ->slideOver() + ->label(__('View')) + ->hiddenLabel() + ->tooltip(__('View')), + ]) + ->bulkActions([ + Tables\Actions\BulkActionGroup::make([ + Tables\Actions\DeleteBulkAction::make(), + ]), + ]); + } + + public static function getPages(): array + { + return [ + 'index' => ListSuppressions::route('/'), + 'view' => ViewSuppression::route('/{record}/view'), + ]; + } +} diff --git a/src/Resources/SuppressionResource/Pages/ListSuppressions.php b/src/Resources/SuppressionResource/Pages/ListSuppressions.php new file mode 100644 index 0000000..efcfae8 --- /dev/null +++ b/src/Resources/SuppressionResource/Pages/ListSuppressions.php @@ -0,0 +1,21 @@ +