Feb 2, 2015
7
Level 3
Add new Adapter to Laravel Filesystem
I want to use replicate adapter as my default filesystem in L5. (local as main storage and Amazon S3 as a backup service). Is there anyway to do this with L5 filesystem ?
http://flysystem.thephpleague.com/adapter/replicate/
Edit: It looks like Laravel only have 2 cloud filesystem out of box : Rackspace and S3. I did find this article http://www.jernejsila.com/zapisi/2014/09/10/add-dropbox-filesystem-driver-laravel-5-project/
But I have to edit framework? Is there any easier way to add new file system driver to L5?
Level 27
There is no need for editing the core files of the framework. You can follow these steps to acheive this:
- Extend the
Illuminate\Filesystem\FilesystemManagerand implement your driver creation strategy i.ecreateXyzDriver(). - Extend the base
Illuminate\Filesystem\FilesystemServiceProviderand override theregisterManagermethod to return your custom instance of themanager.
Usman.
2 likes
Please or to participate in this conversation.