Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

Romain's avatar
Level 30

Nova sidebar submenu

Hi there,

say I have a URL for a filtered resource. I know I want to access this filter more than the default view of the resource, is there a way to add a submenu to that resource with that URL?

I would want something like:

Users
 - Unverified Users (<< this one has the link to the filtered resource)

Thanks

0 likes
5 replies
bugsysha's avatar
bugsysha
Best Answer
Level 61

I create a Nova Resource with that filter always applied and name it accordingly and it shows up in the sidebar. You can also modify the name that shows up in the sidebar if necessary.

1 like
Romain's avatar
Level 30

I guess that would be a solution. I will try that, thanks

Romain's avatar
Level 30

Im so close, I just need a way to access the current user ID within the static method indexQuery, would you have any pointer @bugsysha ? Knowing that the relationship "details" on "User" points to a table that has a column "user_id".

public static function indexQuery(NovaRequest $request, $query)
    {
        return $query
                ->where('valid', false) // << That works fine
                ->with('details', function($query) {
                    $query->where('user_id', '=', (new self)->title()); // <<< no idea. tried self::$title, static::title()
                })
                ->limit(100);
    }
bugsysha's avatar

@romain you have NovaRequest $request injected so you can use $request->user()->id.

Romain's avatar
Level 30

Sorry I don't mean the current user but I want to display all users that are invalid but have details associated with them.

Please or to participate in this conversation.