Skip to content

Commit

Permalink
Add event logic
Browse files Browse the repository at this point in the history
  • Loading branch information
arduinomaster22 committed Jan 14, 2025
1 parent e572b2e commit f8804e0
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/Resources/SuppressionResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
use Illuminate\Database\Eloquent\Builder;
use Vormkracht10\FilamentMails\Resources\SuppressionResource\Pages\ListSuppressions;
use Vormkracht10\Mails\Enums\EventType;
use Vormkracht10\Mails\Events\MailUnsuppressed;
use Vormkracht10\Mails\Models\MailEvent;

class SuppressionResource extends Resource
Expand Down Expand Up @@ -114,8 +115,11 @@ public static function table(Table $table): Table
->searchable(),
])
->actions([
Tables\Actions\Action::make('unsupress')
->action(fn (MailEvent $record) => $record->unSuppress()),
Tables\Actions\Action::make('unsuppress')
->label(__('Unsuppress'))
->action(function (MailEvent $record) {
event(new MailUnsuppressed(key($record->to), $record->mail->driver, $record->mail->stream_id ?? null));

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

View workflow job for this annotation

GitHub Actions / phpstan

Access to an undefined property Vormkracht10\Mails\Models\Mail::$driver.

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

View workflow job for this annotation

GitHub Actions / phpstan

Access to an undefined property Vormkracht10\Mails\Models\MailEvent::$to.

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

View workflow job for this annotation

GitHub Actions / phpstan

Instantiated class Vormkracht10\Mails\Events\MailUnsuppressed not found.
}),

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

0 comments on commit f8804e0

Please sign in to comment.