Skip to content

$menuitem->hideWhen : determining whether menu item is hidden should be based on customized global or menu specific logic #71

@douglassdavis

Description

@douglassdavis

I'm searching for a practical way to use the $menuitem->hideWhen property

  1. Each menu item to be shown or hidden does not appear to be passed to the hideWhen function in order for the function to determine whether the menu item should be displayed, making it less useful.
  2. The logic for whether a menuitem is seen or not seen is probably -not- going to be different for each menu item. More than likely, it will be the same for all menus on the site, or at the maximum different for each menu. Having to set one property per menu item seems impractical.

There should be some way of having a global or maybe menu specific function to hide or show menu items. I could then, for example, base it on route permissions.

This would also be a more simple way to solve the problem of a developer wanting to show/hide menus based on spatie/laravel-permissions, mentioned here: #58

I'll see what I can do to change this. Or, I might be missing something. Please let me know or post a link to a good example.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions