b4zz4r / laravel-alias-storage
Installs: 3 634
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 2
pkg:composer/b4zz4r/laravel-alias-storage
This package has no released version yet, and little information is available.
README
Meta filesystem, witch you can acreate aliases for other filesystems.
Requirement
- PHP >= 7.4
- Laravel >= 8.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!