From 3b3b95fa37116cb33778cca8f2d907a8a9bf5aca Mon Sep 17 00:00:00 2001 From: Dennis Koch Date: Thu, 22 Feb 2024 08:11:11 +0100 Subject: [PATCH] Use `navigationLabel()` for pages --- src/Commands/ResourceCommand.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/Commands/ResourceCommand.php b/src/Commands/ResourceCommand.php index 8f33aa5..3511217 100644 --- a/src/Commands/ResourceCommand.php +++ b/src/Commands/ResourceCommand.php @@ -4,6 +4,7 @@ use Filament\Resources\Pages\CreateRecord; use Filament\Resources\Pages\EditRecord; +use Filament\Resources\Pages\ManageRelatedRecords; use Filament\Resources\Pages\Page; use Filament\Resources\Pages\ViewRecord; use Filament\Resources\Resource; @@ -49,7 +50,7 @@ public function getName(): string return collect([ $this->resource::getNavigationGroup(), $this->resource::getBreadcrumb(), - $this->page->getBreadcrumb(), + $this->page::getNavigationLabel(), ]) ->filter() ->join(' / '); @@ -71,7 +72,9 @@ public function shouldBeShown(): bool protected function hasDependencies(): bool { return match (true) { - $this->page instanceof EditRecord, $this->page instanceof ViewRecord => true, + $this->page instanceof EditRecord => true, + $this->page instanceof ViewRecord => true, + $this->page instanceof ManageRelatedRecords => true, default => false, }; }