example/GoogleUpload.php
public function upload_files()
    {
        $adapter    = new GoogleDriveAdapter($this->service, Cache::get('folder_id'));
        $filesystem = new Filesystem($adapter);

        // here we are uploading files from local storage
        // we first get all the files
        $files = Storage::files();

        // loop over the found files
        foreach ($files as $file) {
            // remove file from google drive in case we have something under the same name
            // comment out if its okay to have files under the same name
            $this->remove_duplicated($file);

            // read the file content
            $read = Storage::get($file);
            // save to google drive
            $filesystem->write($file, $read);
            // remove the local file
            Storage::delete($file);
        }
    }
public function upload_files()
    {
        $adapter    = new GoogleDriveAdapter($this->service, Cache::get('folder_id'));
        $filesystem = new Filesystem($adapter);

        // here we are uploading files from local storage
        // we first get all the files
        $files = Storage::files();

        // loop over the found files
        foreach ($files as $file) {
            // remove file from google drive in case we have something under the same name
            // comment out if its okay to have files under the same name
            $this->remove_duplicated($file);

            // read the file content
            $read = Storage::get($file);
            // save to google drive
            $filesystem->write($file, $read);
            // remove the local file
            Storage::delete($file);
        }
    }
public function upload_files ( ) { $ adapter = new GoogleDriveAdapter ( $ this -> service , Cache :: get ( 'folder_id' ) ) ; $ filesystem = new Filesystem ( $ adapter ) ; // here we are uploading files from local storage // we first get all the files $ files = Storage :: files ( ) ; // loop over the found files foreach ( $ files as $ file ) { // remove file from google drive in case we have something under the same name // comment out if its okay to have files under the same name $ this -> remove_duplicated ( $ file ) ; // read the file content $ read = Storage :: get ( $ file ) ; // save to google drive $ filesystem -> write ( $ file , $ read ) ; // remove the local file Storage :: delete ( $ file ) ; } }
this is the only method u need to call from ur controller.

@param [type] $new_name [description]

@return [type] [description]
this is the only method u need to call from ur controller .