src/Uploader.php
public function upload()
    {
        $params = $this->getUploadParams();

        if ($params) {
            $class = $this->class;
            $uri = $class::getUri();
            $document = static::post($this->client, $uri, $params);

            /** @var Model $instance */
            $instance = new $this->class($this->client, $document);
            $instance->exists = true;
            $instance->cacheFields($document);
            return $instance;
        }

        return null;
    }
public function upload()
    {
        $params = $this->getUploadParams();

        if ($params) {
            $class = $this->class;
            $uri = $class::getUri();
            $document = static::post($this->client, $uri, $params);

            /** @var Model $instance */
            $instance = new $this->class($this->client, $document);
            $instance->exists = true;
            $instance->cacheFields($document);
            return $instance;
        }

        return null;
    }
public function upload ( ) { $ params = $ this -> getUploadParams ( ) ; if ( $ params ) { $ class = $ this -> class ; $ uri = $ class :: getUri ( ) ; $ document = static :: post ( $ this -> client , $ uri , $ params ) ; /** @var Model $instance */ $ instance = new $ this -> class ( $ this -> client , $ document ) ; $ instance -> exists = true ; $ instance -> cacheFields ( $ document ) ; return $ instance ; } return null ; }
Uploads file and returns the model

@return null|Model
Uploads file and returns the model