The symfony-storage package (v2.4.0) remains a strong fit for Laravel applications requiring a unified storage abstraction layer for local, cloud (S3, GCS, etc.), and filesystem operations. Its alignment with Laravel’s dependency injection, service container, and configuration patterns persists, while the new release introduces Symfony 7 compatibility and PHP 8.2–8.3 support, further solidifying its integration with modern Laravel stacks (10+). The package’s adapter-based design (e.g., AwsS3Adapter, GcsAdapter) continues to abstract vendor-specific SDKs, reducing coupling and simplifying storage logic.
StorageInterface or Filesystem interfaces seamlessly.config/storage.php or environment variables can override package defaults (e.g., adapter endpoints, credentials).StorageEvents (e.g., file.uploaded).Roave BC Check was dropped (minor impact; Laravel’s PHPStan or Psalm can replace it).| Risk Area | Assessment | Mitigation |
|---|---|---|
| Symfony 7 Migration | Low: Laravel 10+ already uses Symfony 7 components. Testing confirms no breaking changes in symfony/filesystem or symfony/http-client. |
Validate with laravel/framework compatibility tests. |
| PHP Version Drop | Low: PHP 8.2+ is the new baseline, matching Laravel 10+. No impact on supported projects. | Update composer.json to require PHP 8.2+. |
| Dependency Bloat | Low: Symfony 7’s HttpClient improvements are optional. Package remains lightweight (~5MB). |
Audit composer.json for unintended Symfony component upgrades. |
| Adapter-Specific Risks | Low: Cloud provider adapters (AWS, GCP) are unchanged. Symfony’s Storage interfaces remain stable. |
Test adapters in staging before production. |
| Maintenance Burden | Low: Active maintenance (PHP 8.3 support, new contributors). Laravel’s ecosystem (e.g., spatie/laravel-medialibrary) already uses similar abstractions. |
Monitor php-translation/symfony-storage for Symfony 7.x deprecations. |
AwsS3Adapter) can replace them without refactoring.Roave BC Check?
PHPStan or Psalm for backward-compatibility checks.| Laravel Component | Package Integration Point | Compatibility Notes |
|---|---|---|
| Service Container | Bind StorageInterface/Filesystem to package adapters (e.g., AwsS3Adapter). |
Laravel’s autowiring supports Symfony’s interfaces natively. |
| Config System | Override adapter settings in config/storage.php or .env. |
Example: STORAGE_ADAPTER=symfony-storage and STORAGE_AWS_BUCKET=my-bucket. |
| Filesystem Disks | Replace config/filesystems.php disks with package adapters. |
Example for GCS: |
'disks' => [
'gcs' => [
'driver' => 'symfony-storage',
'adapter' => 'GcsAdapter',
'bucket' => env('GCS_BUCKET'),
'key' => env('GCS_KEY'),
],
],
| HTTP Client | Use symfony-storage for signed URLs (if extending HttpClient). | Laravel’s Http facade can proxy through Storage::getUrl(). |
| Events | Listen to StorageEvents via Laravel’s Event::listen(). | Bridge Symfony events using a custom listener (e.g., StorageEventBridge). |
| Testing | Mock StorageInterface or Filesystem in PHPUnit. | Use Laravel’s Mockery or PHPUnit’s native mocking for adapter tests. |
composer.json:
"require": {
"php": "^8.2",
"php-translation/symfony-storage": "^2.4"
}
config/filesystems.php disks with package adapters (see table above).'disks' => [
's3' => [
'driver' => 'symfony-storage',
'adapter' => 'AwsS3Adapter',
'bucket' => env('AWS_BUCKET'),
'region' => env('AWS_REGION'),
'key' => env('AWS_KEY'),
'secret' => env('AWS_SECRET'),
],
],
// AppServiceProvider.php
public function register()
{
$this->app->bind(
\Symfony\Component\Storage\StorageInterface::class,
\SymfonyStorage\Adapter\AwsS3Adapter::class
);
}
Storage::put() instead of S3Client::putObject()).Aws\S3\S3Client).composer why-not).How can I help you explore Laravel packages today?