Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use navigationLabel() for pages #41

Merged
merged 1 commit into from
Feb 22, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading