protected function upload(UploadableFile $uploadableFile, $transformConfig = [], $appendedPath = null)
    {
        if ($appendedPath) {
            $uploadableFile->appendToUploadPath($appendedPath);
        }

        if ($transformConfig) {
            $uploadableFile->setTransformConfig($transformConfig)->transform();
        }

        //$uploadableFile->setUploadTo(config('soda.upload.folder'));

        $uploadFilePath = $uploadableFile->uploadPath();
        $uploadConfig = [
            'visibility'   => 'public',
            'CacheControl' => 'public, max-age=2592000', // 30 days
        ];

        // Generate return information
        if ($this->driver()->put($uploadFilePath, $uploadableFile->fileContents(), $uploadConfig)) {
            if (config('filesystems.disks.'.config('soda.upload.default').'.driver') == 'local') {
                return substr($this->driver()->getAdapter()->applyPathPrefix($uploadFilePath), strlen(public_path()));
            }

            return $this->driver()->url(trim($uploadFilePath, '/'));
        }

        return false;
    }
protected function upload(UploadableFile $uploadableFile, $transformConfig = [], $appendedPath = null)
    {
        if ($appendedPath) {
            $uploadableFile->appendToUploadPath($appendedPath);
        }

        if ($transformConfig) {
            $uploadableFile->setTransformConfig($transformConfig)->transform();
        }

        //$uploadableFile->setUploadTo(config('soda.upload.folder'));

        $uploadFilePath = $uploadableFile->uploadPath();
        $uploadConfig = [
            'visibility'   => 'public',
            'CacheControl' => 'public, max-age=2592000', // 30 days
        ];

        // Generate return information
        if ($this->driver()->put($uploadFilePath, $uploadableFile->fileContents(), $uploadConfig)) {
            if (config('filesystems.disks.'.config('soda.upload.default').'.driver') == 'local') {
                return substr($this->driver()->getAdapter()->applyPathPrefix($uploadFilePath), strlen(public_path()));
            }

            return $this->driver()->url(trim($uploadFilePath, '/'));
        }

        return false;
    }
protected function upload ( UploadableFile $ uploadableFile , $ transformConfig = [ ] , $ appendedPath = null ) { if ( $ appendedPath ) { $ uploadableFile -> appendToUploadPath ( $ appendedPath ) ; } if ( $ transformConfig ) { $ uploadableFile -> setTransformConfig ( $ transformConfig ) -> transform ( ) ; } //$uploadableFile->setUploadTo(config('soda.upload.folder')); $ uploadFilePath = $ uploadableFile -> uploadPath ( ) ; $ uploadConfig = [ 'visibility' => 'public' , 'CacheControl' => 'public, max-age=2592000' , // 30 days ] ; // Generate return information if ( $ this -> driver ( ) -> put ( $ uploadFilePath , $ uploadableFile -> fileContents ( ) , $ uploadConfig ) ) { if ( config ( 'filesystems.disks.' . config ( 'soda.upload.default' ) . '.driver' ) == 'local' ) { return substr ( $ this -> driver ( ) -> getAdapter ( ) -> applyPathPrefix ( $ uploadFilePath ) , strlen ( public_path ( ) ) ) ; } return $ this -> driver ( ) -> url ( trim ( $ uploadFilePath , '/' ) ) ; } return false ; }
Uploads an UploadableFile instance and returns the path to the image.
Returns false on failure.

@param UploadableFile $uploadableFile
@param array          $transformConfig
@param                $appendedPath

@return bool|string
Uploads an UploadableFile instance and returns the path to the image . Returns false on failure .