diff --git a/composer.json b/composer.json index 3b4dd53..095e93b 100644 --- a/composer.json +++ b/composer.json @@ -23,7 +23,7 @@ "php": "^8.1", "illuminate/filesystem": "^10|^11", "illuminate/support": "^10|^11", - "azure-oss/storage-blob-flysystem": "^1.1" + "azure-oss/storage-blob-flysystem": "^1.2" }, "require-dev": { "laravel/pint": "^1.17", diff --git a/src/AzureStorageBlobAdapter.php b/src/AzureStorageBlobAdapter.php index 54fc14d..40f7d0f 100644 --- a/src/AzureStorageBlobAdapter.php +++ b/src/AzureStorageBlobAdapter.php @@ -31,6 +31,11 @@ public function __construct(array $config) ); } + public function url($path) + { + return $this->adapter->publicUrl($path, new Config); + } + /** @phpstan-ignore-next-line */ public function temporaryUrl($path, $expiration, array $options = []) { diff --git a/tests/AzureStorageBlobAdapterTest.php b/tests/AzureStorageBlobAdapterTest.php index 785f796..3f672f6 100644 --- a/tests/AzureStorageBlobAdapterTest.php +++ b/tests/AzureStorageBlobAdapterTest.php @@ -74,6 +74,10 @@ public function driver_works(): void 'content', Http::get($driver->temporaryUrl('file.txt', now()->addMinute()))->body() ); + self::assertEquals( + 'content', + Http::get($driver->url('file.txt'))->body() + ); $driver->copy('file.txt', 'file2.txt');