Easiest way: Auth::user() && Auth::user()->hasPermission(x)
.
Longer way to make it work with only "Auth::user()
- you can overload the Auth class to return a GuestUser
if there is no current user to act as the NullObject pattern.
Sign in to participate in this thread!