From 651d66ac40e30418f6c0ec118b221a79aa459884 Mon Sep 17 00:00:00 2001 From: Hamees Ahmed Khan <32523517+hameesakhan@users.noreply.github.com> Date: Thu, 31 Oct 2024 14:12:02 -0500 Subject: [PATCH 1/5] Update AzureStorageBlobAdapter.php Changing prefix key with root so that the adapter becomes compatible with other Laravel ecosystem packages --- src/AzureStorageBlobAdapter.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/AzureStorageBlobAdapter.php b/src/AzureStorageBlobAdapter.php index e6ccbda..316121b 100644 --- a/src/AzureStorageBlobAdapter.php +++ b/src/AzureStorageBlobAdapter.php @@ -16,13 +16,13 @@ final class AzureStorageBlobAdapter extends FilesystemAdapter { /** - * @param array{connection_string: string, container: string, prefix?: string} $config + * @param array{connection_string: string, container: string, root?: string} $config */ public function __construct(array $config) { $serviceClient = BlobServiceClient::fromConnectionString($config['connection_string']); $containerClient = $serviceClient->getContainerClient($config['container']); - $adapter = new AzureBlobStorageAdapter($containerClient, $config['prefix'] ?? ''); + $adapter = new AzureBlobStorageAdapter($containerClient, $config['root'] ?? ''); parent::__construct( new Filesystem($adapter, $config), From 3f04e6d89e185015ec0f4f307de7a1250fe97e61 Mon Sep 17 00:00:00 2001 From: Hamees Ahmed Khan <32523517+hameesakhan@users.noreply.github.com> Date: Thu, 31 Oct 2024 14:14:55 -0500 Subject: [PATCH 2/5] Update AzureStorageBlobServiceProvider.php Changing prefix key with root so that the adapter becomes compatible with other Laravel ecosystem packages --- src/AzureStorageBlobServiceProvider.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/AzureStorageBlobServiceProvider.php b/src/AzureStorageBlobServiceProvider.php index a1e56e0..580ba99 100644 --- a/src/AzureStorageBlobServiceProvider.php +++ b/src/AzureStorageBlobServiceProvider.php @@ -23,8 +23,8 @@ public function boot(): void throw new \InvalidArgumentException('The [container] must be a string in the disk configuration.'); } - if (isset($config['prefix']) && ! is_string($config['prefix'])) { - throw new \InvalidArgumentException('The [prefix] must be a string in the disk configuration.'); + if (isset($config['root']) && ! is_string($config['root'])) { + throw new \InvalidArgumentException('The [root] must be a string in the disk configuration.'); } return new AzureStorageBlobAdapter($config); From 89a39d02aab671ebb6e211520b794ea5c2dd3c60 Mon Sep 17 00:00:00 2001 From: Hamees Ahmed Khan <32523517+hameesakhan@users.noreply.github.com> Date: Thu, 31 Oct 2024 14:37:23 -0500 Subject: [PATCH 3/5] Update AzureStorageBlobServiceProvider.php --- src/AzureStorageBlobServiceProvider.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/AzureStorageBlobServiceProvider.php b/src/AzureStorageBlobServiceProvider.php index 580ba99..b44fcb1 100644 --- a/src/AzureStorageBlobServiceProvider.php +++ b/src/AzureStorageBlobServiceProvider.php @@ -23,6 +23,10 @@ public function boot(): void throw new \InvalidArgumentException('The [container] must be a string in the disk configuration.'); } + if (isset($config['prefix']) && ! is_string($config['prefix'])) { + throw new \InvalidArgumentException('The [prefix] must be a string in the disk configuration.'); + } + if (isset($config['root']) && ! is_string($config['root'])) { throw new \InvalidArgumentException('The [root] must be a string in the disk configuration.'); } From 3c0ff047455930df366726ccab2a0f833f011861 Mon Sep 17 00:00:00 2001 From: Hamees Ahmed Khan <32523517+hameesakhan@users.noreply.github.com> Date: Thu, 31 Oct 2024 14:38:10 -0500 Subject: [PATCH 4/5] Update AzureStorageBlobAdapter.php --- src/AzureStorageBlobAdapter.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/AzureStorageBlobAdapter.php b/src/AzureStorageBlobAdapter.php index 316121b..c5662b4 100644 --- a/src/AzureStorageBlobAdapter.php +++ b/src/AzureStorageBlobAdapter.php @@ -22,7 +22,7 @@ public function __construct(array $config) { $serviceClient = BlobServiceClient::fromConnectionString($config['connection_string']); $containerClient = $serviceClient->getContainerClient($config['container']); - $adapter = new AzureBlobStorageAdapter($containerClient, $config['root'] ?? ''); + $adapter = new AzureBlobStorageAdapter($containerClient, $config['prefix'] ?? $config['root'] ?? ''); parent::__construct( new Filesystem($adapter, $config), From d6b0d6e488dfc75474c1cbe559897bb8b73078d3 Mon Sep 17 00:00:00 2001 From: Hamees Ahmed Khan <32523517+hameesakhan@users.noreply.github.com> Date: Thu, 31 Oct 2024 14:38:47 -0500 Subject: [PATCH 5/5] Update AzureStorageBlobAdapter.php --- src/AzureStorageBlobAdapter.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/AzureStorageBlobAdapter.php b/src/AzureStorageBlobAdapter.php index c5662b4..54fc14d 100644 --- a/src/AzureStorageBlobAdapter.php +++ b/src/AzureStorageBlobAdapter.php @@ -16,7 +16,7 @@ final class AzureStorageBlobAdapter extends FilesystemAdapter { /** - * @param array{connection_string: string, container: string, root?: string} $config + * @param array{connection_string: string, container: string, prefix?: string, root?: string} $config */ public function __construct(array $config) {