- Can I use this package directly in Laravel, or is it only for Symfony?
- While the package is a Symfony bundle, its core Flysystem adapter works identically in Laravel. You’ll need to manually bind the Azure adapter in Laravel’s service container and adapt the Symfony config to Laravel’s `config/services.php` or a package-specific config file. The league/flysystem-bundle (v3.7+) compatibility ensures minimal friction.
- What Laravel versions and PHP versions does this package support?
- This package supports Laravel 8+ and PHP 8.0+. The underlying dependencies (league/flysystem-bundle ≥3.7 and azure/storage-blob ≥2.0) are fully compatible with these versions. No additional PHP extensions or Laravel-specific tweaks are required beyond standard Composer installation.
- How do I authenticate with Azure Blob Storage in Laravel?
- Authentication is handled via Azure’s connection strings, SAS tokens, or managed identities. Store these securely in Laravel’s `.env` file (e.g., `AZURE_STORAGE_CONNECTION_STRING`). The bundle’s Flysystem adapter will automatically use these credentials when configured in your Laravel service provider or config file.
- Does this package support soft deletes or versioning for Azure Blob Storage?
- Yes, Azure Blob Storage natively supports both soft deletes (via blob leases) and versioning. Enable versioning by configuring the `versioning` option in your Flysystem adapter settings (e.g., `versioning: true`). Soft deletes require additional logic in your application to track and restore deleted blobs.
- How do I handle large file uploads or parallel uploads in Laravel?
- For large files, use Azure’s BlockBlobUploadOptions to enable parallel uploads. Configure this in your Flysystem adapter settings or directly in the Azure SDK calls. Laravel’s request handling (e.g., chunked uploads via JavaScript) can work alongside this, but ensure your server has sufficient memory and timeout settings for large transfers.
- Are there any Laravel-specific optimizations or gotchas I should know about?
- One gotcha is that Symfony’s `framework.yaml` config must be translated to Laravel’s `config/services.php` or a package-specific config. Also, Laravel’s `Storage` facade may not auto-detect this bundle, so explicitly bind the adapter in your `AppServiceProvider`. Test with Azure’s Blob Storage Emulator to catch edge cases before production.
- Can I use this package alongside other Flysystem adapters like S3?
- Absolutely. The Flysystem abstraction allows you to define multiple disks (e.g., `azure`, `s3`, `local`) in Laravel’s `filesystems.php` config. This is useful for multi-cloud setups or fallback strategies. The bundle’s adapter integrates seamlessly with Laravel’s existing Flysystem ecosystem.
- How do I monitor errors or performance issues with Azure Blob Storage in Laravel?
- Leverage Flysystem’s event system to log errors (e.g., `StorageException`) via Laravel’s logging channels. For performance metrics, use Azure Monitor or integrate with Laravel’s logging to track latency, request volume, and failures. Consider adding custom middleware to wrap Azure SDK calls for granular observability.
- What are the cost implications of using Azure Blob Storage with this package?
- Costs depend on operations (e.g., transactions, data egress) and storage tiers (Hot/Cool/Archive). Use Azure’s pricing calculator to estimate costs based on your expected read/write patterns. Implement lifecycle policies to automate tiering and reduce costs for infrequently accessed data.
- Is there a recommended way to migrate existing Laravel storage (e.g., S3 or local) to Azure Blob Storage?
- Start by syncing data using Laravel’s `Storage` facade or a custom script with the Azure SDK. Replace `storage_path()` references with the new Azure disk configuration in your `config/filesystems.php`. Test thoroughly with a subset of data before full migration, and consider using Azure’s cross-service copy feature for large datasets.