src/Foundation/Uploads/Uploader.php
/**
     * 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.



@return bool|string
Uploads an UploadableFile instance and returns the path to the image . Returns false on failure . @return bool|string
protected function upload(UploadableFile $uploadableFile, $transformConfig = [], $appendedPath = null)
    {
        if ($appendedPath) {
            $uploadableFile->appendToUploadPath($appendedPath);
        }
        if ($transformConfig) {
            $uploadableFile->setTransformConfig($transformConfig)->transform();
        }
        $uploadFilePath = $uploadableFile->uploadPath();
        $uploadConfig = [
            'visibility'   => 'public',
            'CacheControl' => 'public, max-age=2592000', 
        ];
        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 ( ) ; } $ uploadFilePath = $ uploadableFile -> uploadPath ( ) ; $ uploadConfig = [ 'visibility' => 'public' , 'CacheControl' => 'public, max-age=2592000' , ] ; 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.
Uploads an UploadableFile instance and returns the path to the image .
//$uploadableFile->setUploadTo(config('soda.upload.folder')); // 30 days // Generate return information