Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
arduinomaster22 committed Jan 11, 2025
1 parent d6e03f9 commit d7d69ae
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 13 deletions.
8 changes: 1 addition & 7 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,5 @@
}
},
"minimum-stability": "dev",
"prefer-stable": true,
"repositories": {
"laravel-mails": {
"type": "path",
"url": "/var/www/laravel-mails"
}
}
"prefer-stable": true
}
17 changes: 11 additions & 6 deletions src/Resources/SuppressionResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,11 @@
use Filament\Infolists\Infolist;
use Filament\Resources\Resource;
use Filament\Tables;
use Filament\Tables\Actions\Action;
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;
Expand Down Expand Up @@ -61,15 +64,20 @@ public static function getEloquentQuery(): Builder
{
return parent::getEloquentQuery()
->where('type', EventType::HARD_BOUNCED)
->whereNull('unsuppressed_at')
->orWhere('unsuppressed_at', '')
->where(function ($query) {
$query->whereNull('unsuppressed_at')
->orWhere('unsuppressed_at', '');
})
->latest('occurred_at')
->orderBy('occurred_at', 'desc')
->latest('occurred_at')
->orderBy('occurred_at', 'desc');
}

public static function table(Table $table): Table
{
return $table
->headerActions([Action::make('clean')->action(fn() => Artisan::call('app:clean-unsupressions'))])
->defaultSort('occurred_at', 'desc')
->columns([
Tables\Columns\TextColumn::make('mail.to')
Expand All @@ -88,10 +96,7 @@ public static function table(Table $table): Table
])
->actions([
Tables\Actions\Action::make('unsupress')
->action(function (MailEvent $record) {
$record->unsuppressed_at = now();
$record->save();
}),
->action(fn(MailEvent $record) => $record->unSuppress()),

Tables\Actions\ViewAction::make()
->url(null)
Expand Down

0 comments on commit d7d69ae

Please sign in to comment.