Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Gaufrette Laravel Package

knplabs/gaufrette

View on GitHub
Deep Wiki
Context7

currentMenu: azure-blob-storage

AzureBlobStorage

Azure Blob Storage is the storage service provided by Microsoft Windows Azure cloud environment. First, you will need to install the adapter:

composer require gaufrette/azure-blob-storage-adapter

To instantiate the AzureBlobStorage adapter you need a BlobProxyFactoryInterface instance (you can use the default BlobProxyFactory class) and a connection string. The connection string should follow this prototype:

BlobEndpoint=https://XXXXXXXXXX.blob.core.windows.net/;AccountName=XXXXXXXX;AccountKey=XXXXXXXXXXXXXXXXXXXX

You should be able to find your endpoint, account name and account key in your Windows Azure management console.

Thanks to the blob proxy factory, the adapter lazy loads the connection to the endpoint, so it will not create any connection until it's really needed (eg. when a read or write operation is issued).

Multi-container mode

If you specify a container name, adapter will use only that container for all blobs.

If you omit specifying a container, it will use a so-called multi-container mode in which container name is determined directly from key. This allows for more flexibility if you're using dedicated storage accounts per asset type (ie. one for images, one for videos) as you get to group assets logically, use container-level privileges, etc.

Example

<?php

$connectionString = '...';
$factory = new Gaufrette\Adapter\AzureBlobStorage\BlobProxyFactory($connectionString);

// single-container mode
$adapter = new Gaufrette\Adapter\AzureBlobStorage($factory, 'my-container');
$filesystem = new Gaufrette\Filesystem($adapter);
// container=my-container, path=my/stuff.txt
$filesystem->write('my/stuff.txt', 'This is my stuff');

// multi-container mode
$adapter = new Gaufrette\Adapter\AzureBlobStorage($factory);
// make auto-created containers public by default
$containerOptions = new MicrosoftAzure\Storage\Blob\Models\CreateContainerOptions;
$containerOptions->setPublicAccess(true);
$adapter->setCreateContainerOptions($containerOptions);
$filesystem = new Gaufrette\Filesystem($adapter);
// container=my (auto-created), path=stuff.txt
$filesystem->write('my/stuff.txt', 'This is my stuff');

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
ilhamsyabani/laravel-volt-starter
thethunderturner/filament-latex
ghostcompiler/laravel-querybuilder
webrek/laravel-telescope-mongodb
anousss007/blatui
zatona-eg/zatona-eg-api
cocosmos/filament-sticky-save-bar
patrickbussmann/oauth2-apple
3brs/enterprise-security-bundle
anousss007/vigilance
supportpal/eloquent-model
ardenexal/fhir-models
laravel-at/laravel-image-sanitize
romalytar/yammi-audit-log-laravel
ardenexal/fhir-validation
arshaviras/weather-widget
laravel-chronicle/core
sunchayn/nimbus
daikazu/eloquent-salesforce-objects
unseen-codes/chat