Giter Club home page Giter Club logo

Comments (2)

matthewbdaly avatar matthewbdaly commented on June 9, 2024

It's possible to get the file fairly easily from Azure using the config details. Before I created this package I used Graham Campbell's Flysystem package for storing documents on Azure and I had to construct the URL as follows:

$url = 'https://' . config('filesystems.disks.azure.name'). '.blob.core.windows.net/' . config('filesystems.disks.azure.container') . '/' . $filename;

While I haven't used Azure for a while, this should still work unless the naming scheme has drastically changed in the meantime. I will add this to the README for future reference. It'd probably be a good idea to create a reusable helper for your own use case.

It does look like actually getting Storage::get($path) working with Azure isn't likely to be practical. If you look at the url($path) method in https://github.com/laravel/framework/blob/c91c742eb1f6a0cefacde3a558566081f7738f2c/src/Illuminate/Filesystem/FilesystemAdapter.php which actually does the work, it explicitly specifies the adapters that have this functionality. Implementing support for this would therefore be a case of extending that class and adding support for it there, and amending how the framework resolves that particular interface. Extending core parts of the framework like that could be fairly dodgy, so I'm very reluctant to go down that road.

Put it this way, as far as I can see it would be easier to just add this functionality to Laravel itself, but considering the relatively small profile Azure has among Laravel developers compared to S3, I'd be surprised if Taylor Otwell wanted to add that functionality to the core framework. For one piece of functionality that can be duplicated by a simple helper function, it's probably not worth it.

from laravel-azure-storage.

stueynet avatar stueynet commented on June 9, 2024

Thanks @matthewbdaly that makes sense. So essentially just construct the url myself based on the expected url from azure. I would image those don't change too often and are hopefully backward compatible. Would probably make sense to set up a subdomain anyway.

Thanks for the response!

from laravel-azure-storage.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.