diff --git a/README.md b/README.md index 16fe25a..3cd377f 100644 --- a/README.md +++ b/README.md @@ -56,6 +56,7 @@ return [ 'model' => Email::class, 'group' => null, 'sort' => null, + 'icon' => null, 'default_sort_column' => 'created_at', 'default_sort_direction' => 'desc', 'datetime_format' => 'Y-m-d H:i:s', diff --git a/config/filament-email.php b/config/filament-email.php index 2d13d69..02af3d3 100644 --- a/config/filament-email.php +++ b/config/filament-email.php @@ -9,6 +9,7 @@ 'model' => Email::class, 'group' => null, 'sort' => null, + 'icon' => null, 'default_sort_column' => 'created_at', 'default_sort_direction' => 'desc', 'datetime_format' => 'Y-m-d H:i:s', diff --git a/src/Filament/Resources/EmailResource.php b/src/Filament/Resources/EmailResource.php index 8615ee3..a11a61c 100644 --- a/src/Filament/Resources/EmailResource.php +++ b/src/Filament/Resources/EmailResource.php @@ -29,11 +29,10 @@ use RickDBCN\FilamentEmail\Filament\Resources\EmailResource\Pages\ViewEmail; use RickDBCN\FilamentEmail\Mail\ResendMail; use RickDBCN\FilamentEmail\Models\Email; +use Illuminate\Contracts\Support\Htmlable; class EmailResource extends Resource { - protected static ?string $navigationIcon = 'heroicon-o-envelope'; - protected static ?string $slug = 'emails'; public static function getBreadcrumb(): string @@ -46,6 +45,11 @@ public static function getNavigationLabel(): string return config('filament-email.label') ?? __('filament-email::filament-email.navigation_label'); } + public static function getNavigationIcon(): string | Htmlable | null + { + return config('filament-email.resource.icon') ?? 'heroicon-o-envelope'; + } + public static function getNavigationGroup(): ?string { return config('filament-email.resource.group') ?? __('filament-email::filament-email.navigation_group');