From fb3b41ad468b745dc28966c1856ddafd793fc821 Mon Sep 17 00:00:00 2001 From: Henrik B Hansen Date: Tue, 11 Sep 2018 19:28:46 +0200 Subject: [PATCH] Switch to league/flysystem-azure-blob-storage --- composer.json | 2 +- src/AzureStorageServiceProvider.php | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/composer.json b/composer.json index db68d67..3d721ef 100644 --- a/composer.json +++ b/composer.json @@ -4,7 +4,7 @@ "type": "library", "keywords": ["storage","laravel","azure"], "require": { - "league/flysystem-azure": "^1.0" + "league/flysystem-azure-blob-storage": "^0.1.4" }, "require-dev": { "orchestra/testbench": "^3.5", diff --git a/src/AzureStorageServiceProvider.php b/src/AzureStorageServiceProvider.php index 6bcc571..d56b4fd 100644 --- a/src/AzureStorageServiceProvider.php +++ b/src/AzureStorageServiceProvider.php @@ -5,8 +5,8 @@ use Storage; use League\Flysystem\Filesystem; use Illuminate\Support\ServiceProvider; -use League\Flysystem\Azure\AzureAdapter; -use MicrosoftAzure\Storage\Common\ServicesBuilder; +use MicrosoftAzure\Storage\Blob\BlobRestProxy; +use League\Flysystem\AzureBlobStorage\AzureBlobStorageAdapter; /** * Service provider for Azure Blob Storage @@ -26,8 +26,9 @@ public function boot() $config['name'], $config['key'] ); - $blobRestProxy = ServicesBuilder::getInstance()->createBlobService($endpoint); - return new Filesystem(new AzureAdapter($blobRestProxy, "/".$config['container'])); + $client = BlobRestProxy::createBlobService($endpoint); + $adapter = new AzureBlobStorageAdapter($client, $config['container']); + return new Filesystem($adapter); }); }