public function uploadFile(UploadedFile $file)
    {
        $path =   $this->env . '/'  . md5(time() . random_int(1,100000)) . '.'. $file->guessClientExtension();
        /** @var Result $result */
        $result = $this->client->putObject([
            'ACL' => 'public-read',
            'Bucket' => $this->bucketName,
            'SourceFile' => $file->getRealPath(),
            'Key' => $path
        ]);

        return new FileUploadedModel($path, $result->get('ObjectURL'), FileUploadedModel::VENDOR_S3);
    }
public function uploadFile(UploadedFile $file)
    {
        $path =   $this->env . '/'  . md5(time() . random_int(1,100000)) . '.'. $file->guessClientExtension();
        /** @var Result $result */
        $result = $this->client->putObject([
            'ACL' => 'public-read',
            'Bucket' => $this->bucketName,
            'SourceFile' => $file->getRealPath(),
            'Key' => $path
        ]);

        return new FileUploadedModel($path, $result->get('ObjectURL'), FileUploadedModel::VENDOR_S3);
    }
public function uploadFile ( UploadedFile $ file ) { $ path = $ this -> env . '/' . md5 ( time ( ) . random_int ( 1 , 100000 ) ) . '.' . $ file -> guessClientExtension ( ) ; /** @var Result $result */ $ result = $ this -> client -> putObject ( [ 'ACL' => 'public-read' , 'Bucket' => $ this -> bucketName , 'SourceFile' => $ file -> getRealPath ( ) , 'Key' => $ path ] ) ; return new FileUploadedModel ( $ path , $ result -> get ( 'ObjectURL' ) , FileUploadedModel :: VENDOR_S3 ) ; }
Generates a name for the file and uploads it to s3

@param UploadedFile $file
@return FileUploadedModel
Generates a name for the file and uploads it to s3