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

Storage Blob Laravel Package

azure-oss/storage-blob

View on GitHub
Deep Wiki
Context7

Azure Storage Blob PHP

Latest Version on Packagist Packagist Downloads

A PHP SDK for Azure Blob Storage with support for containers, blobs, leases, tags, versions, and SAS generation.

[!IMPORTANT] This package is community-maintained and is not affiliated with, endorsed by, or supported by Microsoft.

Install

composer require azure-oss/storage-blob

Quickstart

<?php

use AzureOss\Storage\Blob\BlobServiceClient;
use AzureOss\Storage\Blob\Models\UploadBlobOptions;

$service = BlobServiceClient::fromConnectionString(
    getenv('AZURE_STORAGE_CONNECTION_STRING')
);

$container = $service->getContainerClient('quickstart');
$container->createIfNotExists();

$blob = $container->getBlobClient('hello.txt');

$blob->upload(
    'Hello from PHP OSS for Azure',
    new UploadBlobOptions(contentType: 'text/plain')
);

$download = $blob->downloadStreaming();
$content = $download->content->getContents();

echo $content.PHP_EOL; // Hello from PHP OSS for Azure

foreach ($container->getBlobs() as $item) {
    echo $item->name.PHP_EOL;
}

// Optional cleanup
$blob->deleteIfExists();
// $container->deleteIfExists();

Features

  • Authentication:
    • Connection strings (access keys)
    • Shared key credentials
    • Shared access signatures (SAS) for delegated, time-limited access
    • Microsoft Entra ID (token-based authentication) via azure-oss/azure-identity
  • Local development:
    • Supports the Azurite emulator
  • Containers:
    • Create, delete, and list (including filtering by prefix)
    • Configure public access when creating a container
    • Read properties and manage metadata
    • Acquire, renew, change, release, and break leases
    • List and restore soft-deleted containers
  • Blobs:
    • Upload from strings or streams, with transfer tuning for large uploads
    • Set common HTTP headers (content type, cache control, etc.)
    • Download via streaming and access response properties
    • Protect reads and writes with ETag, date, and lease ID conditions
    • Acquire, renew, change, release, and break leases
    • Copy blobs (synchronous and asynchronous)
    • List blobs (flat, by prefix, and hierarchical listing) with page sizing
    • Delete and restore soft-deleted blobs
    • Create, read, copy, and delete snapshots
    • Select, read, restore, and delete blob versions
    • Read properties and manage metadata
    • Blob index tags: set/get tags and query blobs by tags (account or container scope)
  • SAS:
    • Generate SAS for blobs, containers, and the account (when using credentials that can sign SAS)

Documentation

You can read the documentation here.

Related packages

Maintenance

This package is part of the community-maintained PHP OSS for Azure project. It is an independent project and is not affiliated with or endorsed by Microsoft.

License

This project is released under the MIT License. See LICENSE for details.

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.
cadot.eu/make
besmartand-pro/php-quality-config
sentix/ai-chatbot
codifyo/ts-generator-bundle
mintobit/jobqueue
a4sex/maintenance-bundle
a4sex/entity-date-update
a4sex/client-identifier
a4sex/base-utilites
a4sex/key-value-storage
a4sex/micro-status
chilldev/dependency-injection-extra
datinglibre/datinglibre-app-api
biberltd/corebundle
bricre/symfony-bundle-test
biberltd/logbundle
dominium/http-adapter-bundle
dominium/google-analytics
a4sex/auto-clean-entity
christhompsontldr/laravel-inky