Resource as Navigation Parent of Custom page

I am currently trying set a resource page as navigation parent of a custom page. when setting the navigation parent of the custom page by changing the navigation parent property, it simply disappears. class TimeEntriesOverview extends Page { protected static ?string $navigationGroup = 'Zeiterfassung & Ausgaben'; protected static ?string $navigationIcon = 'eos-timer'; protected static ?string $navigationLabel = 'Übersicht Zeiterfassung'; protected static ?int $navigationSort = 1; protected static ?string $navigationParentItem = 'Zeiterfassung'; protected static string $view = 'filament.pages.time-entries-overview'; } class TimeEntryResource extends Resource { protected static ?string $model = TimeEntry::class; protected static ?string $navigationGroup = 'Zeiterfassung & Ausgaben'; protected static ?string $navigationIcon = 'eos-timer'; protected static ?string $navigationLabel = 'Zeiterfassung'; protected static ?int $navigationSort = 0; ...
Solution:
Solved it, the necessary attributes to set are ```
protected static ?string $navigationGroup = 'Zeiterfassung & Ausgaben'; protected static ?string $title = 'Übersicht Zeiterfassung';...
Jump to solution
4 Replies
toeknee
toeknee3mo ago
set
php
protected static bool $shouldRegisterNavigation = true;
php
protected static bool $shouldRegisterNavigation = true;
I have a feeling sub items don't auto-register.
Mahjoub
MahjoubOP3mo ago
Thanks for the reply. with the attribute set, the custom page is still hidden as sub item
class TimeEntriesOverview extends Page implements HasTable
{
use InteractsWithTable;

protected static ?string $navigationGroup = 'Zeiterfassung & Ausgaben';
protected static ?string $navigationIcon = 'mdi-timetable';
protected static ?string $navigationLabel = 'ZeiterfassungXXX';
protected static ?int $navigationSort = 0;

protected static bool $shouldRegisterNavigation = true;
protected static ?string $navigationParentItem = 'Zeiterfassung';

...
class TimeEntriesOverview extends Page implements HasTable
{
use InteractsWithTable;

protected static ?string $navigationGroup = 'Zeiterfassung & Ausgaben';
protected static ?string $navigationIcon = 'mdi-timetable';
protected static ?string $navigationLabel = 'ZeiterfassungXXX';
protected static ?int $navigationSort = 0;

protected static bool $shouldRegisterNavigation = true;
protected static ?string $navigationParentItem = 'Zeiterfassung';

...
` @toeknee Could the problem occur because it's a custom page and not a resource?
toeknee
toeknee3mo ago
It will be yes, I can't remember the exact method for allow it to register. Maybe it will need manually setting the panelprovider menuItems
Solution
Mahjoub
Mahjoub3mo ago
Solved it, the necessary attributes to set are

protected static ?string $navigationGroup = 'Zeiterfassung & Ausgaben';
protected static ?string $title = 'Übersicht Zeiterfassung';
protected static ?string $navigationParentItem = 'Zeiterfassung';

protected static ?string $navigationGroup = 'Zeiterfassung & Ausgaben';
protected static ?string $title = 'Übersicht Zeiterfassung';
protected static ?string $navigationParentItem = 'Zeiterfassung';
everything else is redundant and results in unwanted behavior

Did you find this page helpful?