public function save($name, $source, $folder, $override = false)
    {
        $return = false;

        try {
            if (!$this->storage->exists($folder)) {
                $this->storage->createFolder($folder);
            }

            $path = $this->setFilename($name, $folder, $override);
            
            $this->storage->upload($source, $path, $override);

            $return = array(
                'name' => $name,
                'path' => $path,
                'url'  => $this->storage->getUrl($path),
            );
            $this->error = null;

        } catch(Exception $e) {
            $this->error = $e;
            $return = false;
        }
        return $return;
    }
public function save($name, $source, $folder, $override = false)
    {
        $return = false;

        try {
            if (!$this->storage->exists($folder)) {
                $this->storage->createFolder($folder);
            }

            $path = $this->setFilename($name, $folder, $override);
            
            $this->storage->upload($source, $path, $override);

            $return = array(
                'name' => $name,
                'path' => $path,
                'url'  => $this->storage->getUrl($path),
            );
            $this->error = null;

        } catch(Exception $e) {
            $this->error = $e;
            $return = false;
        }
        return $return;
    }
public function save ( $ name , $ source , $ folder , $ override = false ) { $ return = false ; try { if ( ! $ this -> storage -> exists ( $ folder ) ) { $ this -> storage -> createFolder ( $ folder ) ; } $ path = $ this -> setFilename ( $ name , $ folder , $ override ) ; $ this -> storage -> upload ( $ source , $ path , $ override ) ; $ return = array ( 'name' => $ name , 'path' => $ path , 'url' => $ this -> storage -> getUrl ( $ path ) , ) ; $ this -> error = null ; } catch ( Exception $ e ) { $ this -> error = $ e ; $ return = false ; } return $ return ; }
Salva o arquivo no storage

@param string $name     Name Original
@param string $source   Source File
@param string $folder   Remote Folder
@param bool   $override Override?

@return array [name,path,url]|false
Salva o arquivo no storage