The documentation illustrates how to integrate the dropbox flysystem adapter, but does not show you how to integrate with the ZipArchive Adapter or similar.
https://laravel.com/docs/5.4/filesystem#custom-filesystems
https://github.com/thephpleague/flysystem-ziparchive
I tried reading over the methods on the FilesystemManager.php which is the class containing the extend method used in the docs example. I found a method called adapt which looks like it might be the ticket.
I tried calling this method from the Storage facade like so:
return $storage_with_zip = Storage::adapt(new \League\Flysystem\ZipArchive\ZipArchiveAdapter($file->getRealPath()));
but I'm getting this error:
BadMethodCallException
Call to undefined method League\Flysystem\Filesystem::adapt
Has anyone had success integrating the Laravel Filesystem with the ZipArchiveAdapter? I know I can just use the PHP native ZipArchive, but I'd like to have everything in the filesystem use Laravels wrapper.
Thanks!
***Update
My ultimate goal is to be able to unzip uploaded zips to the storage/ directory or to s3.
Example 1)
$file = Storage::disk('local')->extractTo('unzipped/', $file);
instead of this:
$zip = new ZipArchive();
$zip->open($file->getRealPath());
$zip->extractTo(storage_path('app') . 'unzipped');
Example 2)
$file = Storage::disk('s3')->extractTo('unzipped/', $file);