diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml index 122f326..465212e 100644 --- a/.github/ISSUE_TEMPLATE/config.yml +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -1,11 +1,11 @@ blank_issues_enabled: false contact_links: - name: Ask a question - url: https://github.com/vormkracht10/filament-mails/discussions/new?category=q-a + url: https://github.com/backstagephp/filament-mails/discussions/new?category=q-a about: Ask the community for help - name: Request a feature - url: https://github.com/vormkracht10/filament-mails/discussions/new?category=ideas + url: https://github.com/backstagephp/filament-mails/discussions/new?category=ideas about: Share ideas for new features - name: Report a security issue - url: https://github.com/vormkracht10/filament-mails/security/policy + url: https://github.com/backstagephp/filament-mails/security/policy about: Learn how to notify us for sensitive bugs diff --git a/CHANGELOG.md b/CHANGELOG.md index 4d48100..80163bf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,38 +6,38 @@ All notable changes to `filament-mails` will be documented in this file. ### What's Changed -* Fix issue with navigation icons by @Skullbock in https://github.com/vormkracht10/filament-mails/pull/37 +* Fix issue with navigation icons by @Skullbock in https://github.com/backstagephp/filament-mails/pull/37 -**Full Changelog**: https://github.com/vormkracht10/filament-mails/compare/v2.3.4...v2.3.5 +**Full Changelog**: https://github.com/backstagephp/filament-mails/compare/v2.3.4...v2.3.5 ## New feature: Suppressions list with option to unsuppress email addresses - 2025-01-23 ### What's Changed -* Suppressions list by @markvaneijk in https://github.com/vormkracht10/filament-mails/pull/11 +* Suppressions list by @markvaneijk in https://github.com/backstagephp/filament-mails/pull/11 ### New Contributors -* @markvaneijk made their first contribution in https://github.com/vormkracht10/filament-mails/pull/11 +* @markvaneijk made their first contribution in https://github.com/backstagephp/filament-mails/pull/11 -**Full Changelog**: https://github.com/vormkracht10/filament-mails/compare/v2.1.0...v2.2.0 +**Full Changelog**: https://github.com/backstagephp/filament-mails/compare/v2.1.0...v2.2.0 ## v2.1.0 - 2025-01-22 ### What's Changed -* [Fix] Format text to prevent stripping line breaks by @Baspa in https://github.com/vormkracht10/filament-mails/pull/14 -* [Fix] Define nullable parameter as nullable by @Baspa in https://github.com/vormkracht10/filament-mails/pull/15 -* fix: Dynamically determine if tenant is set by @Baspa in https://github.com/vormkracht10/filament-mails/pull/16 -* [Fix] Return empty array when $record's to, cc or bcc is empty (#18) by @vincentvankekerix in https://github.com/vormkracht10/filament-mails/pull/19 -* Update Pages to reflect configured resource class name by @Skullbock in https://github.com/vormkracht10/filament-mails/pull/20 +* [Fix] Format text to prevent stripping line breaks by @Baspa in https://github.com/backstagephp/filament-mails/pull/14 +* [Fix] Define nullable parameter as nullable by @Baspa in https://github.com/backstagephp/filament-mails/pull/15 +* fix: Dynamically determine if tenant is set by @Baspa in https://github.com/backstagephp/filament-mails/pull/16 +* [Fix] Return empty array when $record's to, cc or bcc is empty (#18) by @vincentvankekerix in https://github.com/backstagephp/filament-mails/pull/19 +* Update Pages to reflect configured resource class name by @Skullbock in https://github.com/backstagephp/filament-mails/pull/20 ### New Contributors -* @vincentvankekerix made their first contribution in https://github.com/vormkracht10/filament-mails/pull/19 -* @Skullbock made their first contribution in https://github.com/vormkracht10/filament-mails/pull/20 +* @vincentvankekerix made their first contribution in https://github.com/backstagephp/filament-mails/pull/19 +* @Skullbock made their first contribution in https://github.com/backstagephp/filament-mails/pull/20 -**Full Changelog**: https://github.com/vormkracht10/filament-mails/compare/v2.0.0...v2.1.0 +**Full Changelog**: https://github.com/backstagephp/filament-mails/compare/v2.0.0...v2.1.0 ## v2.0.0 - 2025-01-03 @@ -47,18 +47,18 @@ All notable changes to `filament-mails` will be documented in this file. ### What's Changed -* Install latest version instead of dev-main by @Baspa in https://github.com/vormkracht10/filament-mails/pull/5 -* Use Model from Config for Resource by @iAmKevinMcKee in https://github.com/vormkracht10/filament-mails/pull/7 -* [Fix] PHPStan issues by @Baspa in https://github.com/vormkracht10/filament-mails/pull/6 -* [Fix] Let user specify (tenant aware) routes by @Baspa in https://github.com/vormkracht10/filament-mails/pull/9 -* [Fix] Logging and downloading attachments by @Baspa in https://github.com/vormkracht10/filament-mails/pull/9 +* Install latest version instead of dev-main by @Baspa in https://github.com/backstagephp/filament-mails/pull/5 +* Use Model from Config for Resource by @iAmKevinMcKee in https://github.com/backstagephp/filament-mails/pull/7 +* [Fix] PHPStan issues by @Baspa in https://github.com/backstagephp/filament-mails/pull/6 +* [Fix] Let user specify (tenant aware) routes by @Baspa in https://github.com/backstagephp/filament-mails/pull/9 +* [Fix] Logging and downloading attachments by @Baspa in https://github.com/backstagephp/filament-mails/pull/9 ### New Contributors -* @Baspa made their first contribution in https://github.com/vormkracht10/filament-mails/pull/5 -* @iAmKevinMcKee made their first contribution in https://github.com/vormkracht10/filament-mails/pull/7 +* @Baspa made their first contribution in https://github.com/backstagephp/filament-mails/pull/5 +* @iAmKevinMcKee made their first contribution in https://github.com/backstagephp/filament-mails/pull/7 -**Full Changelog**: https://github.com/vormkracht10/filament-mails/compare/v1.0.1...v2.0.0 +**Full Changelog**: https://github.com/backstagephp/filament-mails/compare/v1.0.1...v2.0.0 ## Bugfix - 2024-11-28 diff --git a/LICENSE.md b/LICENSE.md index cdcbb7a..cb719f5 100644 --- a/LICENSE.md +++ b/LICENSE.md @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) vormkracht10 +Copyright (c) backstagephp Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/README.md b/README.md index 15afbcb..619b539 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,11 @@ # Filament Mails -[![Latest Version on Packagist](https://img.shields.io/packagist/v/vormkracht10/filament-mails.svg?style=flat-square)](https://packagist.org/packages/vormkracht10/filament-mails) -[![GitHub Tests Action Status](https://img.shields.io/github/actions/workflow/status/vormkracht10/filament-mails/run-tests.yml?branch=main&label=tests&style=flat-square)](https://github.com/vormkracht10/filament-mails/actions?query=workflow%3Arun-tests+branch%3Amain) -[![GitHub Code Style Action Status](https://img.shields.io/github/actions/workflow/status/vormkracht10/filament-mails/fix-php-code-styling.yml?branch=main&label=code%20style&style=flat-square)](https://github.com/vormkracht10/filament-mails/actions?query=workflow%3A"Fix+PHP+code+styling"+branch%3Amain) -[![Total Downloads](https://img.shields.io/packagist/dt/vormkracht10/filament-mails.svg?style=flat-square)](https://packagist.org/packages/vormkracht10/filament-mails) +[![Latest Version on Packagist](https://img.shields.io/packagist/v/backstagephp/filament-mails.svg?style=flat-square)](https://packagist.org/packages/backstagephp/filament-mails) +[![GitHub Tests Action Status](https://img.shields.io/github/actions/workflow/status/backstagephp/filament-mails/run-tests.yml?branch=main&label=tests&style=flat-square)](https://github.com/backstagephp/filament-mails/actions?query=workflow%3Arun-tests+branch%3Amain) +[![GitHub Code Style Action Status](https://img.shields.io/github/actions/workflow/status/backstagephp/filament-mails/fix-php-code-styling.yml?branch=main&label=code%20style&style=flat-square)](https://github.com/backstagephp/filament-mails/actions?query=workflow%3A"Fix+PHP+code+styling"+branch%3Amain) +[![Total Downloads](https://img.shields.io/packagist/dt/backstagephp/filament-mails.svg?style=flat-square)](https://packagist.org/packages/backstagephp/filament-mails) -## Nice to meet you, we're [Vormkracht10](https://vormkracht10.nl) +## Nice to meet you, we're [Backstage](https://backstagephp.com) Hi! We are a web development agency from Nijmegen in the Netherlands and we use Laravel for everything: advanced websites with a lot of bells and whistles and large web applications. @@ -29,16 +29,16 @@ Filament Mails can collect everything you might want to track about the mails th Email as a protocol is very error prone. Succesfull email delivery is not guaranteed in any way, so it is best to monitor your email sending realtime. Using external services like Postmark, Mailgun or Resend email gets better by offering things like logging and delivery feedback, but it still needs your attention and can fail silently but horendously. Therefore we created Laravel Mails that fills in all the gaps. -The package is built on top of [Laravel Mails](https://github.com/vormkracht10/laravel-mails). +The package is built on top of [Laravel Mails](https://github.com/backstagephp/laravel-mails). -![Filament Mails](https://raw.githubusercontent.com/vormkracht10/filament-mails/main/docs/filament-mails.jpeg) +![Filament Mails](https://raw.githubusercontent.com/backstagephp/filament-mails/main/docs/filament-mails.jpeg) ## Installation You can install the package via composer: ```bash -composer require vormkracht10/filament-mails +composer require backstage/filament-mails ``` You can publish and run the migrations with: @@ -64,7 +64,7 @@ php artisan vendor:publish --tag="filament-mails-views" Add the routes to the PanelProvider using the `routes()` method, like this: ```php -use Vormkracht10\FilamentMails\Facades\FilamentMails; +use Backstage\FilamentMails\Facades\FilamentMails; public function panel(Panel $panel): Panel { @@ -76,7 +76,7 @@ public function panel(Panel $panel): Panel Then add the plugin to your `PanelProvider` ```php -use Vormkracht10\FilamentMails\FilamentMailsPlugin; +use Backstage\FilamentMails\FilamentMailsPlugin; public function panel(Panel $panel): Panel { @@ -90,8 +90,8 @@ public function panel(Panel $panel): Panel If you want to protect the mail routes with your (tenant) middleware, you can do so by adding the routes to the `tenantRoutes`: ```php -use Vormkracht10\FilamentMails\FilamentMailsPlugin; -use Vormkracht10\FilamentMails\Facades\FilamentMails; +use Backstage\FilamentMails\FilamentMailsPlugin; +use Backstage\FilamentMails\Facades\FilamentMails; public function panel(Panel $panel): Panel { @@ -102,7 +102,7 @@ public function panel(Panel $panel): Panel ``` > [!IMPORTANT] -> For setting up the webhooks to register mail events, please look into the README of [Laravel Mails](https://github.com/vormkracht10/laravel-mails), the underlying package that powers this package. +> For setting up the webhooks to register mail events, please look into the README of [Laravel Mails](https://github.com/backstagephp/laravel-mails), the underlying package that powers this package. ### Configuration @@ -123,34 +123,34 @@ return [ ### List with all sent emails and statistics The package provides a clear overview of all emails, including statistics and the ability to filter the data. -![Filament Mails](https://raw.githubusercontent.com/vormkracht10/filament-mails/main/docs/mails-list.png) +![Filament Mails](https://raw.githubusercontent.com/backstagephp/filament-mails/main/docs/mails-list.png) ### Resending emails You can resend emails to the same or another recipient(s). This is useful when your email has bounced and you want to resend it. -![Filament Mails](https://raw.githubusercontent.com/vormkracht10/filament-mails/main/docs/mail-resend.png) +![Filament Mails](https://raw.githubusercontent.com/backstagephp/filament-mails/main/docs/mail-resend.png) ### Information You can view all relevant information about the email, such as the subject, the body, the attachments, the from address, the to address(es), the cc address(es), the bcc address(es), the reply to address, metadata and much more. -![Filament Mails](https://raw.githubusercontent.com/vormkracht10/filament-mails/main/docs/mail-sender-information.png) -![Filament Mails](https://raw.githubusercontent.com/vormkracht10/filament-mails/main/docs/mail-statistics.png) -![Filament Mails](https://raw.githubusercontent.com/vormkracht10/filament-mails/main/docs/mail-events.png) -![Filament Mails](https://raw.githubusercontent.com/vormkracht10/filament-mails/main/docs/mail-attachments.png) +![Filament Mails](https://raw.githubusercontent.com/backstagephp/filament-mails/main/docs/mail-sender-information.png) +![Filament Mails](https://raw.githubusercontent.com/backstagephp/filament-mails/main/docs/mail-statistics.png) +![Filament Mails](https://raw.githubusercontent.com/backstagephp/filament-mails/main/docs/mail-events.png) +![Filament Mails](https://raw.githubusercontent.com/backstagephp/filament-mails/main/docs/mail-attachments.png) ### Preview email The package provides a preview of the email. This is useful to quickly check if the email is correct. -![Filament Mails](https://raw.githubusercontent.com/vormkracht10/filament-mails/main/docs/mail-preview.png) +![Filament Mails](https://raw.githubusercontent.com/backstagephp/filament-mails/main/docs/mail-preview.png) We also provide the raw HTML and plain text of the email. -![Filament Mails](https://raw.githubusercontent.com/vormkracht10/filament-mails/main/docs/mail-raw-html.png) +![Filament Mails](https://raw.githubusercontent.com/backstagephp/filament-mails/main/docs/mail-raw-html.png) ### Events The package also logs all events that are fired when an email is sent. This is useful to track the email sending process. -![Filament Mails](https://raw.githubusercontent.com/vormkracht10/filament-mails/main/docs/events-list.png) -![Filament Mails](https://raw.githubusercontent.com/vormkracht10/filament-mails/main/docs/event-details.png) +![Filament Mails](https://raw.githubusercontent.com/backstagephp/filament-mails/main/docs/events-list.png) +![Filament Mails](https://raw.githubusercontent.com/backstagephp/filament-mails/main/docs/event-details.png) ## Testing @@ -172,7 +172,7 @@ Please review [our security policy](../../security/policy) on how to report secu ## Credits -- [Baspa](https://github.com/vormkracht10) +- [Baspa](https://github.com/backstagephp) - [Mark van Eijk](https://github.com/markvaneijk) - [All Contributors](../../contributors) diff --git a/composer.json b/composer.json index 955f5e8..c5b7ff8 100644 --- a/composer.json +++ b/composer.json @@ -1,15 +1,15 @@ { - "name": "vormkracht10/filament-mails", + "name": "backstage/filament-mails", "description": "View logged mails and events in a beautiful Filament UI.", "keywords": [ - "vormkracht10", + "backstagephp", "laravel", "filament-mails" ], - "homepage": "https://github.com/vormkracht10/filament-mails", + "homepage": "https://github.com/backstagephp/filament-mails", "support": { - "issues": "https://github.com/vormkracht10/filament-mails/issues", - "source": "https://github.com/vormkracht10/filament-mails" + "issues": "https://github.com/backstagephp/filament-mails/issues", + "source": "https://github.com/backstagephp/filament-mails" }, "license": "MIT", "authors": [ @@ -20,31 +20,27 @@ } ], "require": { - "php": "^8.1", - "filament/filament": "^3.0", + "php": "^8.2", + "filament/filament": "^4.0", "spatie/laravel-package-tools": "^1.15.0", - "vormkracht10/laravel-mails": "^1.0" + "backstage/laravel-mails": "^2.0" }, "require-dev": { - "laravel/pint": "^1.0", - "nunomaduro/collision": "^7.9", - "nunomaduro/larastan": "^2.0.1", - "orchestra/testbench": "^8.0", - "pestphp/pest": "^2.1", - "pestphp/pest-plugin-arch": "^2.0", - "pestphp/pest-plugin-laravel": "^2.0", - "phpstan/extension-installer": "^1.1", - "phpstan/phpstan-deprecation-rules": "^1.0", - "phpstan/phpstan-phpunit": "^1.0" + "laravel/pint": "^1.16", + "nunomaduro/collision": "^8.8.0", + "orchestra/testbench": "^9.0|^10.0", + "pestphp/pest": "^3.7", + "pestphp/pest-plugin-arch": "^3.1.0", + "pestphp/pest-plugin-laravel": "^3.0" }, "autoload": { "psr-4": { - "Vormkracht10\\FilamentMails\\": "src/" + "Backstage\\FilamentMails\\": "src/" } }, "autoload-dev": { "psr-4": { - "Vormkracht10\\FilamentMails\\Tests\\": "tests/" + "Backstage\\FilamentMails\\Tests\\": "tests/" } }, "scripts": { @@ -65,13 +61,19 @@ "extra": { "laravel": { "providers": [ - "Vormkracht10\\FilamentMails\\FilamentMailsServiceProvider" + "Backstage\\FilamentMails\\FilamentMailsServiceProvider" ], "aliases": { - "FilamentMails": "Vormkracht10\\FilamentMails\\Facades\\FilamentMails" + "FilamentMails": "Backstage\\FilamentMails\\Facades\\FilamentMails" } } }, "minimum-stability": "dev", - "prefer-stable": true -} \ No newline at end of file + "prefer-stable": true, + "repositories": { + "backstage/laravel-mails": { + "type": "vcs", + "url": "git@github.com:backstagephp/laravel-mails.git" + } + } +} diff --git a/config/filament-mails.php b/config/filament-mails.php index 69da592..e2680ec 100644 --- a/config/filament-mails.php +++ b/config/filament-mails.php @@ -1,8 +1,8 @@ [ diff --git a/phpunit.xml.dist b/phpunit.xml.dist index f7d5428..ae36eaa 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -16,7 +16,7 @@ backupStaticProperties="false" > - + tests diff --git a/src/Controllers/MailDownloadController.php b/src/Controllers/MailDownloadController.php index 8c007b2..7898a66 100644 --- a/src/Controllers/MailDownloadController.php +++ b/src/Controllers/MailDownloadController.php @@ -1,7 +1,8 @@ downloadFileFromStorage(); diff --git a/src/Controllers/MailPreviewController.php b/src/Controllers/MailPreviewController.php index 358669d..90e66fa 100644 --- a/src/Controllers/MailPreviewController.php +++ b/src/Controllers/MailPreviewController.php @@ -1,10 +1,10 @@ Color::Purple, ]) ->resources([ - config('filament-mails.resources.mail', \Vormkracht10\FilamentMails\Resources\MailResource::class), - config('filament-mails.resources.event', \Vormkracht10\FilamentMails\Resources\EventResource::class), - config('filament-mails.resources.suppression', \Vormkracht10\FilamentMails\Resources\SuppressionResource::class), + config('filament-mails.resources.mail', MailResource::class), + config('filament-mails.resources.event', EventResource::class), + config('filament-mails.resources.suppression', SuppressionResource::class), ]); } diff --git a/src/FilamentMailsServiceProvider.php b/src/FilamentMailsServiceProvider.php index ccb18e9..b2f499f 100644 --- a/src/FilamentMailsServiceProvider.php +++ b/src/FilamentMailsServiceProvider.php @@ -1,7 +1,8 @@ publishConfigFile() ->publishMigrations() ->askToRunMigrations() - ->askToStarRepoOnGitHub('vormkracht10/filament-mails'); + ->askToStarRepoOnGitHub('backstagephp/filament-mails'); }); $configFileName = $package->shortName(); @@ -87,7 +87,7 @@ public function packageBooted(): void protected function getAssetPackageName(): ?string { - return 'vormkracht10/filament-mails'; + return 'backstagephp/filament-mails'; } /** diff --git a/src/Resources/EventResource.php b/src/Resources/EventResource.php index c6cd169..cd4c5fc 100644 --- a/src/Resources/EventResource.php +++ b/src/Resources/EventResource.php @@ -1,18 +1,22 @@ schema([ + return $schema + ->components([ Section::make(__('Event Details')) ->icon('heroicon-o-information-circle') ->compact() @@ -201,7 +205,7 @@ public static function table(Table $table): Table ->defaultSort('occurred_at', 'desc') ->paginated([50, 100, 'all']) ->columns([ - Tables\Columns\TextColumn::make('type') + TextColumn::make('type') ->label(__('Type')) ->sortable() ->badge() @@ -219,10 +223,10 @@ public static function table(Table $table): Table return ucwords(str_replace('_', ' ', $state->value)); }) ->searchable(), - Tables\Columns\TextColumn::make('mail.subject') + TextColumn::make('mail.subject') ->label(__('Subject')) ->searchable(['subject', 'payload']), - Tables\Columns\TextColumn::make('occurred_at') + TextColumn::make('occurred_at') ->label(__('Occurred At')) ->dateTime('d-m-Y H:i') ->since() @@ -233,8 +237,8 @@ public static function table(Table $table): Table ->filters([ // ]) - ->actions([ - Tables\Actions\ViewAction::make() + ->recordActions([ + ViewAction::make() ->url(null) ->modal() ->slideOver() @@ -242,9 +246,9 @@ public static function table(Table $table): Table ->hiddenLabel() ->tooltip(__('View')), ]) - ->bulkActions([ - Tables\Actions\BulkActionGroup::make([ - Tables\Actions\DeleteBulkAction::make(), + ->toolbarActions([ + BulkActionGroup::make([ + DeleteBulkAction::make(), ]), ]); } diff --git a/src/Resources/EventResource/Pages/ListEvents.php b/src/Resources/EventResource/Pages/ListEvents.php index 0765c97..cbb41fd 100644 --- a/src/Resources/EventResource/Pages/ListEvents.php +++ b/src/Resources/EventResource/Pages/ListEvents.php @@ -1,14 +1,13 @@ schema([ + return $schema + ->components([ Section::make('General') ->icon('heroicon-o-envelope') ->compact() @@ -178,7 +183,7 @@ public static function infolist(Infolist $infolist): Infolist ->label(__('Type')) ->badge() ->url(function (MailEvent $record) { - $panel = Filament::getCurrentPanel(); + $panel = Filament::getCurrentOrDefaultPanel(); $tenant = Filament::getTenant(); if (! $panel || ! $tenant) { @@ -205,7 +210,7 @@ public static function infolist(Infolist $infolist): Infolist }), TextEntry::make('occurred_at') ->url(function (MailEvent $record) { - $panel = Filament::getCurrentPanel(); + $panel = Filament::getCurrentOrDefaultPanel(); $tenant = Filament::getTenant(); if (! $panel || ! $tenant) { @@ -318,7 +323,7 @@ public static function table(Table $table): Table ->defaultSort('created_at', 'desc') ->paginated([50, 100, 'all']) ->columns([ - Tables\Columns\TextColumn::make('status') + TextColumn::make('status') ->label(__('Status')) ->sortable() ->searchable(false) @@ -335,32 +340,32 @@ public static function table(Table $table): Table __('Unsent') => 'gray', default => 'gray', }), - Tables\Columns\TextColumn::make('subject') + TextColumn::make('subject') ->label(__('Subject')) ->limit(35) ->sortable() ->searchable(['subject', 'html', 'text']), - Tables\Columns\IconColumn::make('attachments') + IconColumn::make('attachments') ->label('') ->alignLeft() ->searchable(false) ->getStateUsing(fn (Mail $record) => $record->attachments->count() > 0) ->icon(fn (string $state): string => $state ? 'heroicon-o-paper-clip' : ''), - Tables\Columns\TextColumn::make('to') + TextColumn::make('to') ->label(__('Recipient(s)')) ->limit(50) ->getStateUsing(fn (Mail $record) => self::formatMailState(emails: $record->to, mailOnly: true)) ->sortable() ->searchable(), - Tables\Columns\TextColumn::make('opens') + TextColumn::make('opens') ->label(__('Opens')) ->tooltip(fn (Mail $record) => __('Last opened at :date', ['date' => $record->last_opened_at?->format('d-m-Y H:i')])) ->sortable(), - Tables\Columns\TextColumn::make('clicks') + TextColumn::make('clicks') ->label(__('Clicks')) ->tooltip(fn (Mail $record) => __('Last clicked at :date', ['date' => $record->last_clicked_at?->format('d-m-Y H:i')])) ->sortable(), - Tables\Columns\TextColumn::make('sent_at') + TextColumn::make('sent_at') ->label(__('Sent At')) ->dateTime('d-m-Y H:i') ->since() @@ -374,8 +379,8 @@ public static function table(Table $table): Table ->filters([ // ]) - ->actions([ - Tables\Actions\ViewAction::make() + ->recordActions([ + ViewAction::make() // ->url(null) ->modal() ->slideOver() @@ -389,7 +394,7 @@ public static function table(Table $table): Table ->modalDescription(__('Are you sure you want to resend this mail?')) ->hiddenLabel() ->tooltip(__('Resend')) - ->form(self::getResendForm()) + ->schema(self::getResendForm()) ->fillForm(function (Mail $record) { return [ 'to' => array_keys($record->to ?: []), @@ -406,14 +411,14 @@ public static function table(Table $table): Table ->send(); }), ]) - ->bulkActions([ - Tables\Actions\BulkActionGroup::make([ - Tables\Actions\BulkAction::make('resend') + ->toolbarActions([ + BulkActionGroup::make([ + BulkAction::make('resend') ->label(__('Resend')) ->icon('heroicon-o-arrow-uturn-right') ->requiresConfirmation() ->modalDescription(__('Are you sure you want to resend the selected mails?')) - ->form(fn ($records) => self::getBulkResendForm($records)) + ->schema(fn ($records) => self::getBulkResendForm($records)) ->action(function (Collection $records, array $data) { foreach ($records as $record) { (new ResendMail)->handle($record, $data['to'], $data['cc'] ?? [], $data['bcc'] ?? []); @@ -425,7 +430,7 @@ public static function table(Table $table): Table ->send(); }) ->deselectRecordsAfterCompletion(), - Tables\Actions\DeleteBulkAction::make(), + DeleteBulkAction::make(), ]), ]); } diff --git a/src/Resources/MailResource/Pages/ListMails.php b/src/Resources/MailResource/Pages/ListMails.php index 940f627..ae44853 100644 --- a/src/Resources/MailResource/Pages/ListMails.php +++ b/src/Resources/MailResource/Pages/ListMails.php @@ -1,13 +1,13 @@ defaultSort('occurred_at', 'desc') ->columns([ - Tables\Columns\TextColumn::make('to') + TextColumn::make('to') ->label(__('Email address')) ->formatStateUsing(fn ($record) => key(json_decode($record->to ?? []))) ->searchable(['to']), - Tables\Columns\TextColumn::make('id') + TextColumn::make('id') ->label(__('Reason')) ->badge() ->formatStateUsing(fn ($record) => $record->type->value == EventType::COMPLAINED->value ? 'Complained' : 'Bounced') @@ -117,7 +120,7 @@ public static function table(Table $table): Table default => 'gray', }), - Tables\Columns\TextColumn::make('occurred_at') + TextColumn::make('occurred_at') ->label(__('Occurred At')) ->dateTime('d-m-Y H:i') ->since() @@ -125,22 +128,22 @@ public static function table(Table $table): Table ->sortable() ->searchable(), ]) - ->actions([ - Tables\Actions\Action::make('unsuppress') + ->recordActions([ + Action::make('unsuppress') ->label(__('Unsuppress')) ->action(function (MailEvent $record) { event(new MailUnsuppressed(key($record->mail->to), $record->mail->mailer == 'smtp' && filled($record->mail->transport) ? $record->mail->transport : $record->mail->mailer, $record->mail->stream_id ?? null)); }) ->visible(fn ($record) => Provider::tryFrom($record->mail->mailer == 'smtp' && filled($record->mail->transport) ? $record->mail->transport : $record->mail->mailer)), - Tables\Actions\ViewAction::make() + ViewAction::make() ->url(null) ->modal() ->slideOver() ->label(__('View')) ->hiddenLabel() ->tooltip(__('View')) - ->infolist(fn (Infolist $infolist) => EventResource::infolist($infolist)), + ->schema(fn (Schema $schema) => EventResource::infolist($schema)), ]); } diff --git a/src/Resources/SuppressionResource/Pages/ListSuppressions.php b/src/Resources/SuppressionResource/Pages/ListSuppressions.php index f864885..03282a4 100644 --- a/src/Resources/SuppressionResource/Pages/ListSuppressions.php +++ b/src/Resources/SuppressionResource/Pages/ListSuppressions.php @@ -1,9 +1,9 @@ in(__DIR__); diff --git a/tests/TestCase.php b/tests/TestCase.php index 6cce5ee..c167eec 100644 --- a/tests/TestCase.php +++ b/tests/TestCase.php @@ -1,7 +1,8 @@ 'Vormkracht10\\FilamentMails\\Database\\Factories\\' . class_basename($modelName) . 'Factory' + fn (string $modelName) => 'Backstage\\FilamentMails\\Database\\Factories\\' . class_basename($modelName) . 'Factory' ); }