Weave 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 Common

Storage Common Laravel Package

azure-oss/storage-common

Community-maintained PHP primitives shared by the Azure Storage SDK packages: shared key authentication, HTTP pipeline middleware, API version and ETag value objects, account SAS builders, and connection string helpers. Most apps should install a top-level client instead.

View on GitHub
Deep Wiki
Context7

Shared primitives for Azure Storage PHP SDK packages

Frequently asked questions about Storage Common
What is azure-oss/storage-common used for in a Laravel app?
It provides low-level Azure Storage primitives such as StorageSharedKeyCredential, AccountSasBuilder, ApiVersion, ETag, HTTP pipeline middleware, and connection string helpers. In Laravel, you typically use it to generate account SAS tokens or share authentication and API version logic across Azure Storage integrations. Most applications should not start here unless they need those building blocks directly.
Should I install azure-oss/storage-common or azure-oss/storage-blob?
Install a top-level client such as azure-oss/storage-blob or azure-oss/storage-queue for normal blob or queue operations, because storage-common is usually pulled in transitively. Install azure-oss/storage-common directly only when you need low-level primitives like AccountSasBuilder or StorageSharedKeyCredential. This keeps your dependency surface smaller and your application code focused on the storage service you actually use.
How do I install azure-oss/storage-common with Composer?
Run composer require azure-oss/storage-common in your Laravel project. The package is installed from Packagist and has no Laravel-specific installer or service provider requirement. After installation, import the primitives you need, such as StorageSharedKeyCredential and AccountSasBuilder.
Is azure-oss/storage-common compatible with Laravel 9, 10, and 11?
The package is framework-agnostic and targets PHP 8.0+ features, so it fits Laravel 9 and newer releases as long as your PHP version meets Laravel's requirements. The assessment notes Laravel 9+ compatibility and recommends testing on PHP 8.2+ when using newer Laravel features. Always run your own compatibility tests against the exact Laravel and PHP versions you deploy.
How do I generate an Azure Storage account SAS token in Laravel?
Create a StorageSharedKeyCredential with your account name and key, then build an AccountSasBuilder with services, resource types, permissions, and expiry. Call build with the credential and use the returned token in your request or URL. In Laravel, wrap this in a singleton service so configuration and expiry rules stay consistent across controllers and jobs.
How should I configure Azure Storage credentials and SAS settings in Laravel?
Put AZURE_STORAGE_ACCOUNT_NAME and AZURE_STORAGE_ACCOUNT_KEY in your .env file, then expose them through config/services.php or a dedicated config/azure.php file. Register a service that reads those values and constructs StorageSharedKeyCredential and AccountSasBuilder instances. Keep SAS defaults such as expiry and permissions in config so you can override them without changing code.
Does azure-oss/storage-common provide a Laravel Storage facade or Flysystem adapter?
No, storage-common is a primitives package and does not ship a Laravel Filesystem adapter or storage_disk('azure')->url() implementation. For Flysystem integration, use the related azure-oss/storage-blob-flysystem package and generate SAS URLs with the SAS builders. You can then extend Laravel's FilesystemManager or a custom disk to combine Flysystem operations with SAS URL generation.
Can I customize SAS expiry, permissions, and resource types with azure-oss/storage-common?
Yes, AccountSasBuilder exposes methods such as setServices, setResourceTypes, setPermissions, and setExpiresOn. That lets you drive read-only versus read-write permissions and expiry windows from Laravel configuration. Build a small wrapper service if you want to validate inputs and apply consistent defaults across your app.
How do I test Azure SAS token generation in Laravel?
Unit test your wrapper by freezing time, setting known credential values, and asserting the generated SAS contains the expected permissions, resource types, services, and expiry. Mock or bind a fake credential only if your wrapper depends on one, and add integration tests for each storage type you use. Also test invalid inputs such as malformed expiry values to confirm your Laravel exceptions are thrown.
Is azure-oss/storage-common maintained, and what alternatives should I consider for Laravel?
It is community-maintained and not affiliated with, endorsed by, or supported by Microsoft, so review GitHub and Packagist activity before relying on it in production. Pin a tested version, monitor releases, and test SAS behavior when updating. Alternatives include Microsoft's official Azure Storage SDK for PHP or the higher-level azure-oss/storage-blob and storage-blob-flysystem packages, depending on whether you need primitives or a full client.
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.
xiloryx/log-collector
a21ns1g4ts/filament-stripe
la-php/laravel-admin
artisan-build/community-prompts
vleroy/smart
ayles-software/laravel-australian-public-holidays
cboxdk/laravel-id-spatie
cboxdk/laravel-id-billing
cboxdk/laravel-id-billing-bridge
simple-as-fuck/php-performance-log
hsluv/hsluv
seampact/codegen
seampact/hooks
seampact/ir
mehedimi/laravel-amp-mail
happones/laravel-vue-i18n-generator
jwerd/inertia-table
siberfx/flysystem-wasabi
hollyit/token-replace
ippanelcom/laravel-sdk