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)
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.
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);
}