laravel-menu
laravel-menu copied to clipboard
Filtering items: Class "App\Http\Middleware\User" not found
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).
I have not looked at this myself, but if this is the case, a PR for the documentation could be useful.
Good point. I was hoping someone could verify. It worked for me on L9, but YMMV in other versions.