Skip to content

Commit

Permalink
updates
Browse files Browse the repository at this point in the history
  • Loading branch information
markvaneijk committed Feb 25, 2025
1 parent 0aaf007 commit 61b9070
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 70 deletions.
3 changes: 1 addition & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,7 @@
},
"autoload": {
"psr-4": {
"Vormkracht10\\FilamentMails\\": "src/",
"Vormkracht10\\FilamentMails\\Database\\Factories\\": "database/factories/"
"Vormkracht10\\FilamentMails\\": "src/"
}
},
"autoload-dev": {
Expand Down
19 changes: 0 additions & 19 deletions database/factories/ModelFactory.php

This file was deleted.

19 changes: 0 additions & 19 deletions database/migrations/create_mails_table.php.stub

This file was deleted.

4 changes: 0 additions & 4 deletions src/FilamentMailsServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,6 @@ public function configurePackage(Package $package): void
$package->hasConfigFile();
}

if (file_exists($package->basePath('/../database/migrations'))) {
$package->hasMigrations($this->getMigrations());
}

if (file_exists($package->basePath('/../resources/lang'))) {
$package->hasTranslations();
$this->loadJsonTranslationsFrom($package->basePath('/../resources/lang'));
Expand Down
24 changes: 9 additions & 15 deletions src/Resources/EventResource/Pages/ListEvents.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,34 +39,28 @@ public function getTabs(): array
'delivered' => Tab::make()
->label(__('Delivered'))
->badgeColor('success')
->icon('heroicon-o-check-circle')
->icon('heroicon-o-inbox-arrow-down')
->badge(MailEvent::where('type', EventType::DELIVERED)->count())
->modifyQueryUsing(fn (Builder $query) => $query->where('type', EventType::DELIVERED)),

'clicked' => Tab::make()
->label(__('Clicked'))
->badgeColor('clicked')
->icon('heroicon-o-cursor-arrow-rays')
->badge(MailEvent::where('type', EventType::CLICKED)->count())
->modifyQueryUsing(fn (Builder $query) => $query->where('type', EventType::CLICKED)),

'opened' => Tab::make()
->label(__('Opened'))
->badgeColor('info')
->icon('heroicon-o-envelope-open')
->badge(MailEvent::where('type', EventType::OPENED)->count())
->modifyQueryUsing(fn (Builder $query) => $query->where('type', EventType::OPENED)),

'soft_bounce' => Tab::make()
->label(__('Soft Bounced'))
->icon('heroicon-o-x-circle')
->badge(MailEvent::where('type', EventType::SOFT_BOUNCED)->count())
->modifyQueryUsing(fn (Builder $query) => $query->where('type', EventType::SOFT_BOUNCED)),
'clicked' => Tab::make()
->label(__('Clicked'))
->badgeColor('clicked')
->icon('heroicon-o-cursor-arrow-rays')
->badge(MailEvent::where('type', EventType::CLICKED)->count())
->modifyQueryUsing(fn (Builder $query) => $query->where('type', EventType::CLICKED)),

'bounced' => Tab::make()
->label(__('Bounced'))
->badgeColor('danger')
->icon('heroicon-o-x-circle')
->icon('heroicon-o-arrow-path-rounded-square')
->badge(fn () => MailEvent::where('type', EventType::SOFT_BOUNCED)->count() + MailEvent::where('type', EventType::HARD_BOUNCED)->count())
->modifyQueryUsing(fn (Builder $query) => $query->where(function ($query) {
$query->where('type', EventType::SOFT_BOUNCED)
Expand All @@ -76,7 +70,7 @@ public function getTabs(): array
'complained' => Tab::make()
->label(__('Complained'))
->badgeColor('warning')
->icon('heroicon-o-exclamation-circle')
->icon('heroicon-o-face-frown')
->badge(MailEvent::where('type', EventType::COMPLAINED)->count())
->modifyQueryUsing(fn (Builder $query) => $query->where('type', EventType::COMPLAINED)),
];
Expand Down
12 changes: 6 additions & 6 deletions src/Resources/MailResource/Pages/ListMails.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,13 @@ public function getTabs(): array
'all' => Tab::make()
->label(__('All'))
->badgeColor('primary')
->icon('heroicon-o-inbox')
->icon('heroicon-o-inbox-stack')
->badge($class::count()),

'unsent' => Tab::make()
->label(__('Unsent'))
->badgeColor('gray')
->icon('heroicon-o-x-circle')
->icon('heroicon-o-inbox')
->badge($class::unsent()->count())
->modifyQueryUsing(function (Builder $query) use ($class): Builder {
return $class->unsent();
Expand All @@ -61,7 +61,7 @@ public function getTabs(): array
'delivered' => Tab::make()
->label(__('Delivered'))
->badgeColor('success')
->icon('heroicon-o-check-circle')
->icon('heroicon-o-inbox-arrow-down')
->badge($class::delivered()->count())
->modifyQueryUsing(function (Builder $query) use ($class): Builder {
return $class->delivered();
Expand All @@ -70,7 +70,7 @@ public function getTabs(): array
'opened' => Tab::make()
->label(__('Opened'))
->badgeColor('info')
->icon('heroicon-o-eye')
->icon('heroicon-o-envelope-open')
->badge($class::opened()->count())
->modifyQueryUsing(function (Builder $query) use ($class): Builder {
return $class->opened();
Expand All @@ -88,7 +88,7 @@ public function getTabs(): array
'bounced' => Tab::make()
->label(__('Bounced'))
->badgeColor('danger')
->icon('heroicon-o-x-circle')
->icon('heroicon-o-arrow-path-rounded-square')
->badge(fn () => $class::softBounced()->count() + $class::hardBounced()->count())
->modifyQueryUsing(function (Builder $query) use ($class): Builder {
return $query->where(function (Builder $subQuery) use ($class) {
Expand All @@ -100,7 +100,7 @@ public function getTabs(): array
'complained' => Tab::make()
->label(__('Complained'))
->badgeColor('gray')
->icon('heroicon-o-x-circle')
->icon('heroicon-o-face-frown')
->badge($class::complained()->count())
->modifyQueryUsing(function (Builder $query) use ($class): Builder {
return $class->complained();
Expand Down
5 changes: 0 additions & 5 deletions tests/TestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,5 @@ protected function getPackageProviders($app)
public function getEnvironmentSetUp($app)
{
config()->set('database.default', 'testing');

/*
$migration = include __DIR__.'/../database/migrations/create_filament-mails_table.php.stub';
$migration->up();
*/
}
}

0 comments on commit 61b9070

Please sign in to comment.