how would I add a user menu item dynamically?
I have added the example in a custom provider and it works.
Now I want to apply this for only some users
}
});
I tried auth()->user->can('access tools'); but user is null at this point.
user->can('access tools') is a permission (spatie ) that is registered.
2 Replies
Where did you do the check for
auth()->user()
? I think it should work inside of Filament::serving( ... )
Updated the code above to show where I tested for User. and got this message
Undefined property: Illuminate\Auth\AuthManager::$user
I use the wrong facade
use Illuminate\Support\Facades\Auth; S/B
if (Auth::user()->can('access tools')) {
I'm learning thanks for the question got me to look at it differently