F
Filament12mo ago
Dhruva

Call to undefined method Filament\Resources\Pages\PageRegistration::shouldRegisterNavigation()

I am getting folloiwng error when I am trying to add getRecordSubNavigation method in the resource
Call to undefined method Filament\Resources\Pages\PageRegistration::shouldRegisterNavigation()
Call to undefined method Filament\Resources\Pages\PageRegistration::shouldRegisterNavigation()
protected static SubNavigationPosition $subNavigationPosition = SubNavigationPosition::Top;

public static function getRecordSubNavigation(Page $page): array
{
return $page->generateNavigationItems([
Pages\ViewRecord::route('/{record}'),
Pages\EditRecord::route('/{record}/edit'),
]);
}
protected static SubNavigationPosition $subNavigationPosition = SubNavigationPosition::Top;

public static function getRecordSubNavigation(Page $page): array
{
return $page->generateNavigationItems([
Pages\ViewRecord::route('/{record}'),
Pages\EditRecord::route('/{record}/edit'),
]);
}
4 Replies
JJSanders
JJSanders12mo ago
I think you forgot to add the error message
Dhruva
DhruvaOP12mo ago
HI @JJSanders The error I am receiving is
Call to undefined method Filament\Resources\Pages\PageRegistration::shouldRegisterNavigation()
Call to undefined method Filament\Resources\Pages\PageRegistration::shouldRegisterNavigation()
Dhruva
DhruvaOP12mo ago
Thanks @JJSanders Its working now. But I am still not able to figure out what was the issue.

Did you find this page helpful?