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

Filtering items: Class "App\Http\Middleware\User" not found #297

Open
discern opened this issue Jun 26, 2022 · 2 comments
Open

Filtering items: Class "App\Http\Middleware\User" not found #297

discern opened this issue Jun 26, 2022 · 2 comments
Labels

Comments

@discern
Copy link

discern commented Jun 26, 2022

I just wanted to point out to anyone having issues with the Filtering the items section for checking is a user can see the menu item based on their permissions, that you may need to use if (\Auth::user()->can(... instead of if (User::get()->can(... for this to work. As the documentation is currently written, you may receive an error (I did).

@dustingraham
Copy link
Collaborator

I have not looked at this myself, but if this is the case, a PR for the documentation could be useful.

@discern
Copy link
Author

discern commented Jun 28, 2022

Good point. I was hoping someone could verify. It worked for me on L9, but YMMV in other versions.

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

2 participants