laravel-menu icon indicating copy to clipboard operation
laravel-menu copied to clipboard

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

Open discern opened this issue 2 years ago • 2 comments

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).

discern avatar Jun 26 '22 15:06 discern

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

dustingraham avatar Jun 28 '22 14:06 dustingraham

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

discern avatar Jun 28 '22 16:06 discern