danhunsaker / laravel-flysystem-service
Automatically registers every Flysystem adapter it recognizes as a Laravel Filesystem Driver.
Fund package maintenance!
danhunsaker
Patreon
Ko Fi
Liberapay
paypal.me/hunsakerdan
Installs: 32 801
Dependents: 1
Suggesters: 0
Security: 0
Stars: 2
Watchers: 2
Forks: 5
Open Issues: 2
Requires
- illuminate/filesystem: >= 9.0
- illuminate/support: >= 9.0
- league/flysystem: ^3.0
Requires (Dev)
- phpunit/phpunit: ^9.0
Suggests
- league/flysystem-async-aws-s3: Required to use the 'async-s3' adapter (^3.0)
- league/flysystem-aws-s3-v3: Required to use the 's3' adapter using Laravel's built-in support (^3.0)
- league/flysystem-azure-blob-storage: Required to use the 'azure' adapter (^3.0)
- league/flysystem-ftp: Required to use the 'ftp' adapter using Laravel's built-in support (^3.0)
- league/flysystem-google-cloud-storage: Required to use the 'google' adapter (^3.0)
- league/flysystem-memory: Required to use the 'memory' adapter (^3.0)
- league/flysystem-sftp-v3: Required to use the 'sftp' adapter using Laravel's built-in support (^3.0)
- league/flysystem-webdav: Required to use the 'webdav' adapter (^3.0)
- league/flysystem-ziparchive: Required to use the 'zip' adapter (^3.0)
README
Registers recognized Flysystem adapters with Laravel automatically.
This lets you use other adapters without having to write your own service providers to load them properly. It automatically detects which adapters are available, and registers only the ones actually installed.
Note: This package only recognizes the adapters officially supported by The PHP League - for other adapters, install danhunsaker/laravel-flysystem-others instead (it will pull in this package as a dependency).
Installation
The usual methods for using Composer apply here:
composer require danhunsaker/laravel-flysystem-service
You do still have to register one service, but only one, and at least you don't
have to write it. Be sure to REPLACE the
Illuminate\Filesystem\FilesystemServiceProvider::class
line with the new one:
// In config/app.php 'providers' => [ // ... Danhunsaker\Laravel\Flysystem\FlysystemServiceProvider::class, // ... ],
Setup
You can get example definitions for all supported filesystem drivers by
publishing the replacement filesystems
config - just run the following Artisan
command:
php artisan vendor:publish --provider=Danhunsaker\\Laravel\\Flysystem\\FlysystemServiceProvider --force
The --force
flag is required to overwrite the existing filesystems
config
that ships with Laravel. You can also rename the existing file, then run the
command without the --force
flag, if you'd like to preserve the existing
contents for transfer to the new file.
Contributions
Pull requests, bug reports, and so forth are all welcome on GitHub.
Security issues should be reported directly to hennikhunsaker (plus) laraflyserv (at) gmail (dot) com.
And head to GitHub for everything else.