original_string: public function getAllPermissions(): Collection
      {
          $permissions = $this->permissions;
  
          if ($this->roles) {
              $permissions = $permissions->merge($this->getPermissionsViaRoles());
          }
  
          return $permissions->sort()->values();
      }
code: public function getAllPermissions(): Collection
      {
          $permissions = $this->permissions;
  
          if ($this->roles) {
              $permissions = $permissions->merge($this->getPermissionsViaRoles());
          }
  
          return $permissions->sort()->values();
      }
code_tokens: public function getAllPermissions ( ) : Collection { $ permissions = $ this -> permissions ; if ( $ this -> roles ) { $ permissions = $ permissions -> merge ( $ this -> getPermissionsViaRoles ( ) ) ; } return $ permissions -> sort ( ) -> values ( ) ; }
docstring: Return all the permissions the model has, both directly and via roles.
  
  @throws \Exception
docstring_tokens: Return all the permissions the model has both directly and via roles .