authorizeForUser($this->getUser(), 'admin:access'); if (!is_null($additionalPermission)) { $this->authorizeForUser($this->getUser(), $additionalPermission); } } /** * Gets either the authenticated user, or a user object representing the anonymous user. * @return User */ protected function getUser() { $user = Auth::user(); return (is_null($user) ? User::anonymous() : $user); } }