Skip to content

Commit

Permalink
Merge pull request #46 from BorisWild/patch-1
Browse files Browse the repository at this point in the history
Update FilamentJobsMonitorPlugin.php for Localization
  • Loading branch information
croustibat authored Jul 4, 2024
2 parents 68e7c02 + d11a682 commit d9c32a1
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/FilamentJobsMonitorPlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class FilamentJobsMonitorPlugin implements Plugin
/**
* The resource navigation group.
*/
protected ?string $navigationGroup = null;
protected string|Closure|null $navigationGroup = null;

/**
* The resource navigation icon.
Expand Down Expand Up @@ -137,7 +137,7 @@ public function getLabel(): ?string
/**
* Set the resource label.
*/
public function label(string $label): static
public function label(string|Closure $label): static
{
$this->label = $label;

Expand All @@ -155,7 +155,7 @@ public function getPluralLabel(): ?string
/**
* Set the plural resource label.
*/
public function pluralLabel(string $pluralLabel): static
public function pluralLabel(string|Closure $pluralLabel): static
{
$this->pluralLabel = $pluralLabel;

Expand All @@ -175,13 +175,13 @@ public function getClusterName(): ?string
*/
public function getNavigationGroup(): ?string
{
return $this->navigationGroup ?? config('filament-jobs-monitor.resources.navigation_group');
return $this->evaluate($this->navigationGroup) ?? config('filament-jobs-monitor.resources.navigation_group');
}

/**
* Set the resource navigation group.
*/
public function navigationGroup(string $navigationGroup): static
public function navigationGroup(string|Closure $navigationGroup): static
{
$this->navigationGroup = $navigationGroup;

Expand Down

0 comments on commit d9c32a1

Please sign in to comment.