Render Hook for inserting livewire custom page into user menu?

I have several panels, and some pages are shared between panels, so I have the panel directories, and then I have a shared directory where all the pages/components live that are used in multiple panels.

I want to add a link to a user settings page, and since it will be shared, I want to put it in this shared directory. However, when I create a custom page class like I have with a lot of other use cases, and I use the userMenuItems method on the panel provider, I get a route not defined error and I can't seem to get past it.

->userMenuItems([
            MenuItem::make()
                ->url(fn(): string => Settings::getUrl(['userId' => auth()->id()])),
        ]);


my custom page class:
class Settings extends Page
{

    protected static string $view = 'filament.shared.pages.users.settings';
    protected static ?string $slug = 'users/{userId}/settings';
    protected static bool $shouldRegisterNavigation = false;

    public function mount(int $userId)
    {
...


2 questions:

first, am I doing something wrong that would allow me to just make this work the way it's laid out above? I don't know why I can't just link to whatever page I want to, whether it's in the panel or not (I'm guessing that's the problem).

With the other pages I have that are shared, I have a custom sidebar navigation where I'm creating the NavigationItems manually. This is the first time I've tried to put one of these in the user menu.

second, if the above isn't going to work, is there a way to maybe use a renderhook to put a link in my user menu.

I can do this, I think, but just thinking there must be a better way.

 FilamentView::registerRenderHook(
            PanelsRenderHook::USER_MENU_PROFILE_BEFORE,
            fn(): ?String => Blade::render('<div class="fi-dropdown-list p-1">
    <a href="http://localhost/users/1/settings"...</a></div>'),
        );
Was this page helpful?