Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
bezhanSalleh committed Jan 25, 2024
1 parent 23b1aa0 commit 87dbc50
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 2 deletions.
18 changes: 18 additions & 0 deletions src/Concerns/HasNavigation.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,14 @@

namespace BezhanSalleh\FilamentExceptions\Concerns;

use Filament\Clusters\Cluster;
use Filament\Pages\SubNavigationPosition;

trait HasNavigation
{
/** @var class-string<Cluster> | null */
protected ?string $cluster = null;

protected bool $shouldEnableNavigationBadge = false;

protected string | array | null $navigationBadgeColor = null;
Expand Down Expand Up @@ -147,4 +151,18 @@ public function getSlug(): ?string
{
return $this->slug;
}

public function cluster(string $cluster):static
{
$this->cluster = $cluster;

return $this;
}
/**
* @return class-string<Cluster> | null
*/
public function getCluster(): ?string
{
return $this->cluster;
}
}
2 changes: 1 addition & 1 deletion src/FilamentExceptionsPlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public function register(Panel $panel): void

public function boot(Panel $panel): void
{
//

}

public static function get(): static
Expand Down
2 changes: 2 additions & 0 deletions src/FilamentExceptionsServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ public function packageRegistered(): void
$this->app->scoped('filament-exceptions', function ($app): FilamentExceptions {
return new FilamentExceptions($app->make(Request::class));
});


}

public function packageBooted(): void
Expand Down
2 changes: 1 addition & 1 deletion src/Resources/ExceptionResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public static function getNavigationBadge(): ?string

public static function shouldRegisterNavigation(): bool
{
return static::getPlugin()->shouldRegisterNavigation();
return filled(FilamentExceptions::getCluster()) && static::getPlugin()->shouldRegisterNavigation();
}

public static function getNavigationSort(): ?int
Expand Down

0 comments on commit 87dbc50

Please sign in to comment.