src/Wormhole.php
/**
     * Save file to storage.
     *
     * @param  UploadedFile  $file  The file to upload
     * @param  string  $directory  The directory in which file should be saved, default is 'files'.
     * @param  string  $disk  The disk where the file should upload
     * @return string The file name
     * @throws Exception
     */
Save file to storage.
@param  UploadedFile  $file  The file to upload
@param  string  $directory  The directory in which file should be saved, default is 'files'.
@param  string  $disk  The disk where the file should upload
@return string The file name
@throws Exception
Save file to storage . @param UploadedFile $file The file to upload @param string $directory The directory in which file should be saved default is ' files ' . @param string $disk The disk where the file should upload @return string The file name @throws Exception
public function saveFile(UploadedFile $file, string $directory = 'files', string $disk = 'public'): string
    {
        try {
            $filename = Str::random(8).'_'.time().'.'.$file->getClientOriginalExtension();
            $file->storeAs($directory.'/', $filename, $disk);
            return $filename;
        } catch (Exception $exception) {
            throw $exception;
        }
    }
public function saveFile ( UploadedFile $ file , string $ directory = 'files' , string $ disk = 'public' ) : string { try { $ filename = Str :: random ( 8 ) . '_' . time ( ) . '.' . $ file -> getClientOriginalExtension ( ) ; $ file -> storeAs ( $ directory . '/' , $ filename , $ disk ) ; return $ filename ; } catch ( Exception $ exception ) { throw $ exception ; } }
Save file to storage.
Save file to storage .