Skip to content

Commit

Permalink
Merge pull request #58 from sitenzo/main
Browse files Browse the repository at this point in the history
Add config for navigation icon
  • Loading branch information
marcogermani87 authored May 9, 2024
2 parents 26b726d + a5450a4 commit 102aeeb
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
1 change: 1 addition & 0 deletions config/filament-email.php
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
8 changes: 6 additions & 2 deletions src/Filament/Resources/EmailResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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');
Expand Down

0 comments on commit 102aeeb

Please sign in to comment.