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

Fix: Collection resource subnav extension #1902

Merged
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
9 changes: 4 additions & 5 deletions packages/admin/src/Filament/Resources/CollectionResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

use Filament\Forms;
use Filament\Forms\Components\Component;
use Filament\Pages\Page;
use Filament\Pages\SubNavigationPosition;
use Illuminate\Contracts\Support\Htmlable;
use Illuminate\Database\Eloquent\Builder;
Expand Down Expand Up @@ -89,16 +88,16 @@ protected static function getDefaultRelations(): array
return [];
}

public static function getRecordSubNavigation(Page $page): array
public static function getDefaultSubNavigation(): array
{
return $page->generateNavigationItems([
return [
Pages\EditCollection::class,
Pages\ManageCollectionChildren::class,
Pages\ManageCollectionProducts::class,
Pages\ManageCollectionAvailability::class,
Pages\ManageCollectionMedia::class,
Pages\ManageCollectionUrls::class,
]);
];
}

public static function getDefaultPages(): array
Expand All @@ -114,7 +113,7 @@ public static function getDefaultPages(): array
];
}

public static function getGlobalSearchResultTitle(Model $record): string|Htmlable
public static function getGlobalSearchResultTitle(Model $record): string | Htmlable
{
return $record->translateAttribute('name');
}
Expand Down