public function canAtLeast(array $permissions)
    {
        $can = false;

        if (auth()->check()) {
            foreach ($this->roles as $role) {
                if ($role->canAtLeast($permissions)) {
                    $can = true;
                }
            }
        } else {
            $guest = Role::whereSlug('guest')->first();

            if ($guest) {
                return $guest->canAtLeast($permissions);
            }
        }

        return $can;
    }
public function canAtLeast(array $permissions)
    {
        $can = false;

        if (auth()->check()) {
            foreach ($this->roles as $role) {
                if ($role->canAtLeast($permissions)) {
                    $can = true;
                }
            }
        } else {
            $guest = Role::whereSlug('guest')->first();

            if ($guest) {
                return $guest->canAtLeast($permissions);
            }
        }

        return $can;
    }
public function canAtLeast ( array $ permissions ) { $ can = false ; if ( auth ( ) -> check ( ) ) { foreach ( $ this -> roles as $ role ) { if ( $ role -> canAtLeast ( $ permissions ) ) { $ can = true ; } } } else { $ guest = Role :: whereSlug ( 'guest' ) -> first ( ) ; if ( $ guest ) { return $ guest -> canAtLeast ( $ permissions ) ; } } return $ can ; }
Check if user has at least one of the given permissions

@param  array $permissions
@return bool
Check if user has at least one of the given permissions