besanek / laravel-alias-storage
Installs: 38 943
Dependents: 0
Suggesters: 0
Security: 0
Stars: 2
Watchers: 2
Forks: 4
Open Issues: 0
Requires
- php: ^8.1
- illuminate/filesystem: ^10.0|^11.0
- illuminate/support: ^10.0|^11.0
Requires (Dev)
- mockery/mockery: ~1.0
- orchestra/testbench: ^8.0|^9.0
- phpunit/phpunit: ^10.0
README
Meta filesystem, witch you can acreate aliases for other filesystems.
Requirement
- PHP >= 8.1
- Laravel = 10.x
Installing
$ composer require "besanek/laravel-alias-storage"
Basic Usage
<?php // config/filesystems.php return [ 'something' => [ 'driver' => 'alias', 'target' => 'local', ], ];
In that case, calling Storage::disk('something')
will returns local filesystem.
Real life use case
<?php // config/filesystems.php return [ 'video' => [ 'driver' => 'alias', 'target' => env('VIDEO_STORAGE', 'local'), ], 'local' => [ 'driver' => 'local', 'root' => storage_path('app'), ], 's3' => [ 'driver' => 's3', // config ... ] ];
In local development, you can store videos in local filesystem. But in production, you can set environment VIDEO_STORAGE=s3
and
your video uploads are stored and served from S3. Awesome!