Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

@can feature on menu items based on permissions #5847

Open
Jhamende opened this issue Mar 14, 2024 · 0 comments
Open

@can feature on menu items based on permissions #5847

Jhamende opened this issue Mar 14, 2024 · 0 comments
Labels

Comments

@Jhamende
Copy link

Jhamende commented Mar 14, 2024

Laravel version

9.52.16

PHP version

8.1.27

Voyager version

1.7

Description of problem

I made a custom menu through menu builder with dynamic routes to the BREAD's.
In my view I am looking for a way to only show items current logged in user is allowed to browse.

Proposed solution

having the @can funtion to be able to add routes like @can('browse', $menu_item->route); or @if(Auth::user()->can('browse_' . $menu_item->parameters->name)) in every view

Alternatives considered

No response

Additional context

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant