laravel-raid-storage-driver provides encapsulation of the flysystem-raid package for Laravel applications.
Require the package using composer
composer require phpguus/laravel-raid-storage-driver
In config/filesystems.php
, you can now create a disk (in the disks
subarray)
that has the "raid" driver.
'redundantStorage' => [
'driver' => 'raid',
'raidLevel' => 1,
'disks' => [
'diskOne', 'diskTwo', 'diskThree'
];
];
This allows to use the disk as simple as in
Storage::disk('redundantStorage')->write('myfile.txt', 'Something!');
... or in case you are handling uploaded files:
$file->store('', 'redundantStorage');
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
Please make sure to update tests as appropriate.