Replies: 1 comment
-
Hi @wsdnathan You can combine conditions, as well as write not the name of the routes with a mask, but also the url of the address. //...
->active($this->activeMenu($resource))
private function activeMenu(Resource $resource): array
{
return [
route('platform.resource.list', [
'resource' => $resource::uriKey(),
]),
route('platform.resource.create', [
'resource' => $resource::uriKey(),
]),
route('platform.resource.view', [
'resource' => $resource::uriKey(),
'id' => '*',
]),
route('platform.resource.edit', [
'resource' => $resource::uriKey(),
'id' => '*',
]),
];
}
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I think this is a simple question.
I have multiple crud resources and for displayInNavigation() return false, but then manually add those into PlatformProvider navigation. For the Menu item I can add
->active('platform.resource*')
to then highlight active nav when you are on the page, the issue is that any of the Resources matches that pattern. How can I differentiate between different resource paths rather than using this wildcard? I'm not exactly sure how to determine what each individual route is defined as for different Resources.When you set displayInNavigation() to return true, the Resources highlight correctly in the nav on their own. But the reason I return false and add to the PlatformProvider is so that I can mix and match Resources with Screens in the nav without having all the Resources getting grouped together at the bottom of the nav.
Beta Was this translation helpful? Give feedback.
All reactions