league/flysystem-ziparchive
Flysystem ZipArchive adapter sub-split. Use it to work with ZIP files via Flysystem’s filesystem abstraction. This repo is read-only for packaging; file issues and pull requests on the main Flysystem project: https://github.com/thephpleague/flysystem
Adopt When:
Look Elsewhere If:
ZipStream or pclzip.adm-zip or archiver.ZipArchive or libzip bindings."This package lets us treat ZIP archives like any other storage system—just like S3 or local files—using the same code. For example, we can automatically package user uploads into ZIPs for secure delivery, or generate compressed reports without adding a full-time dev to the project. It’s a 2-week integration that unlocks features like ‘download all my files as one ZIP’ or ‘backup this dataset to cloud storage,’ reducing support costs and improving user experience. The MIT license means no hidden costs, and it’s battle-tested by the League of Extraordinary Packages."
*"This is a Flysystem adapter for PHP’s built-in ZipArchive, so it plugs into our existing file storage layer seamlessly. Key benefits:
Storage::disk('zip_archive')->put() just like Storage::disk('s3')->put().ZipArchive (not a streaming solution), so avoid for huge files (>100MB) or encryption-heavy workflows. For those, we’d need to scope separately."**"Imagine writing this:
$zip = Storage::disk('zip_archive')->create('report.zip');
$zip->put('data/report.csv', $csvData);
$zip->put('data/image.png', file_get_contents('image.png'));
No more manual ZipArchive calls or error-prone string concatenation. The adapter handles paths, permissions, and even streaming reads/writes. Perfect for:
How can I help you explore Laravel packages today?