- How do I use this package with Laravel’s Storage facade?
- This package works as a custom filesystem driver for Laravel’s Storage facade. You’ll need to register the AzureBlobAdapter in your `filesystems.php` config and configure it with your Azure connection string or SAS token. The package maintains compatibility with Laravel’s `Storage::disk()` and `temporaryUrl()` methods, so existing Laravel storage logic will work with minimal adjustments.
- Does this package support Laravel 10/11?
- Yes, the package has no breaking changes for Laravel 10 or 11. The recent SAS token update (v2.2.2) is internal to the Azure SDK and does not affect Laravel’s Storage facade contract. You can safely use it with the latest Laravel versions without compatibility issues.
- How do I generate a temporary URL for a blob in Laravel?
- Use Laravel’s built-in `Storage::disk('azure_blob')->temporaryUrl($path, $minutes)` method. The package now includes an updated SAS token helper (via `DateHelper`) that ensures RFC 3339 timestamp formatting for better compatibility with Azure’s shared access policies. If you’re using custom SAS logic, ensure it aligns with the new helper’s timestamp generation.
- Will this package work with Azure CDN or Front Door?
- Yes, the package’s SAS tokens are fully compatible with Azure CDN and Front Door for signed URL caching. The updated timestamp formatting in v2.2.2 ensures better alignment with Azure’s security best practices, making it ideal for dynamic content delivery via CDN. Just configure your CDN to use the signed URLs generated by Laravel’s `temporaryUrl()` method.
- What authentication methods does this package support?
- The package supports connection strings (access keys), shared key credentials, Shared Access Signatures (SAS), and Microsoft Entra ID (token-based authentication) via the `azure-oss/azure-identity` package. For Laravel, you’ll typically use the connection string or SAS tokens in your `.env` file, just like other storage drivers.
- How do I handle timezone issues with SAS tokens?
- The package now uses RFC 3339 timestamps for SAS tokens, which are UTC-based. If your Laravel app’s `app.timezone` differs from UTC, ensure your custom SAS logic (if any) explicitly converts timestamps to UTC before generating tokens. The new `DateHelper` in the package simplifies this by defaulting to UTC, reducing timezone-related issues.
- Can I use this package with Azurite for local development?
- Yes, the package explicitly supports the Azurite emulator for local development. You can configure your Laravel `filesystems.php` to use Azurite’s connection string during development, then switch to your production Azure Blob Storage connection string in `.env`. This makes testing and debugging seamless.
- Are there any performance implications with the new SAS token format?
- The updated SAS token format (v2.2.2) introduces minimal overhead, primarily for timestamp generation. Benchmarks show negligible performance impact for typical Laravel use cases, as the change is isolated to internal Azure SDK logic. The trade-off is improved security and compatibility with Azure’s latest policies.
- How do I migrate from an older version of this package?
- If you’re upgrading from a version before 2.2.2, test your existing SAS token workflows (e.g., `Storage::disk()->temporaryUrl()`) to ensure compatibility with the new timestamp format. No breaking changes exist in the public API, but custom SAS logic relying on older timestamp generation should be updated to use the package’s new `DateHelper`. The migration is straightforward for most Laravel applications.
- What alternatives exist for Azure Blob Storage in Laravel?
- Alternatives include the `league/flysystem-azure` package, which provides a Flysystem adapter for Azure Blob Storage, or the `spatie/laravel-azure-storage` package, which offers a more Laravel-centric wrapper. However, `azure-oss/storage-blob` is the official PHP SDK for Azure Blob Storage, offering deeper integration with Azure’s features like leases, snapshots, and hierarchical blob listings, which may be critical for advanced use cases.