academe / laravel-azure-file-storage-driver

Azure File Storage filesystem driver for Laravel
MIT License
16 stars 1 forks source link

Call to protected method Consilience\Flysystem\Azure\AzureFileAdapter::getUrl() from context 'Illuminate\Filesystem\FilesystemAdapter' #1

Closed emtiazzahid closed 6 years ago

emtiazzahid commented 6 years ago

When i tried to get the image in blade with url, its showing Call to protected method Consilience\Flysystem\Azure\AzureFileAdapter::getUrl() from context 'Illuminate\Filesystem\FilesystemAdapter'

in blade i write image src like this : <img src="{{ \Storage::disk('azure')->url('public/uploads/mailbox/1/cbdf041a-6e01-42f0-868f-91bfccdae2bc.png') }}" alt="Azure Image">

Can you please help me to get over this.

judgej commented 6 years ago

If you make the method public, does this work? Could you post or send me an example URL.

The assumption on my part is that these URLs require authentication to use, so would not be any use outside the context of the flysystem. But if some of these URLs can be accessed publicly, then it makes sense if the URLs are available to the application too.

emtiazzahid commented 6 years ago

yes it works when i changed it from protected to public.

judgej commented 6 years ago

Do you have an example path you could give me, or any details on what needs to be set up to make the paths public? I just get a "invalid headers" error when I try to access a path, due to lack of authentication.

judgej commented 6 years ago

It's the URL the desktop app provides, so I'll just make it a public method.

judgej commented 6 years ago

Try updating the package and its dependencies. getUrl() should now be public.

InvokerMaster commented 6 years ago

Hello. Can you explain how to get stream from Azure File Storage? Just noticed that there is a function called readStream.

judgej commented 6 years ago

This is the general documentation for flysystem streams:

https://flysystem.thephpleague.com/docs/usage/filesystem-api/#using-streams-for-reads-and-writes

Laravel exposes the full flysystem driver, so you should be able to access the stream reader directly. It is not an area I have tested extensively at this stage, but should work.

judgej commented 6 years ago

@emtiazzahid did you get a chance to try out the updated flysystem driver? I'll close this issue, but feel free to follow it up on the underlying driver package if you are still having problems here: https://github.com/academe/flysystem-azure-file-storage/issues/3

InvokerMaster commented 6 years ago

Thank you for your reply. Well actually I get stream data to show video from Azure file storage. And I just wanted to make sure that the stream methods on flysystem in Laravel also works for this repo.

InvokerMaster commented 6 years ago

If it's possible then Thank you very much

judgej commented 6 years ago

Give it a go, and let me know on https://github.com/academe/flysystem-azure-file-storage/issues if it does not.

InvokerMaster commented 6 years ago

Okay. Thank you