laravel-azure-storage
laravel-azure-storage copied to clipboard
Invalid URL generation when using the `prefix` config
Checklist
This package is just a wrapper for Flysystem's Azure storage backend to integrate it with Laravel's storage API. As such, many problems users may experience with it may actually be issues with Flysystem, the Azure driver for Flysystem, or Microsoft's PHP SDK. To help eliminate these issues, please confirm the following:
- [x] I'm able to instantiate a Flysystem instance using the same credentials as passed to this package.
- [x] The Flysystem instance works as expected, and the bug I am reporting is not reproducible when interacting directly with Flysystem
- [x] I can instantiate the Microsoft Azure PHP SDK successfully and can interact with my file successfully using that
Describe the bug
When using a configured prefix, the URL returned by the url
method ignores the prefix and is invalid.
To Reproduce
- Config a disk with a prefix:
my_prefix
. - Using the package, create a simple file
test.txt
with any content. - Generate the URL for the file using the
url()
method. - Notice that the URL does not contain the prefix.
- Open the URL in the browser and confirm that the file is not accessible on the informed URL.
- Manually add the prefix in the URL and open in the browser.
- Confirm that the file was created with the correct prefix.
Expected behavior
The URL returned form the url()
method should be correct and contain the prefix configured.
Packages and PHP version Any
Screenshots
Desktop (please complete the following information): Any
Smartphone (please complete the following information): Any
I've put together a test case for this (and finally got around to migrating the package from PHPUnit to Pest), and have implemented a fix which resolves the broken test case, and have published it as 2.0.5. However, I don't currently have access to an Azure blob storage account so can't verify it works myself.
Can you confirm this has resolved the issue for you?
Closed due to not hearing back