Skip to content

Commit

Permalink
Merge pull request #41 from pxlrbt/fix/use-navigation-label
Browse files Browse the repository at this point in the history
Use `navigationLabel()` for pages
  • Loading branch information
pxlrbt authored Feb 22, 2024
2 parents 6d8bbb2 + 3b3b95f commit b6232c0
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/Commands/ResourceCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -49,7 +50,7 @@ public function getName(): string
return collect([
$this->resource::getNavigationGroup(),
$this->resource::getBreadcrumb(),
$this->page->getBreadcrumb(),
$this->page::getNavigationLabel(),
])
->filter()
->join(' / ');
Expand All @@ -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,
};
}
Expand Down

0 comments on commit b6232c0

Please sign in to comment.