zanysoft / laravel-zip

MIT License
300 stars 95 forks source link

zanysoft/laravel-zip

Downloads GitHub license Maintenance GitHub tag

laravel-zip is the world's leading zip utility for file compression and backup.

This library was written to simplify and automate Zip files management using PHP ZipArchive.

Installation

Require this package in your composer.json and update composer. This will download the package.

composer require zanysoft/laravel-zip

After updating composer, add the ServiceProvider to the providers array in config/app.php

ZanySoft\Zip\ZipServiceProvider::class,

You can optionally use the facade for shorter code. Add this to your facades:

'Zip' => ZanySoft\Zip\Facades\Zip::class,

Zip usage

use ZanySoft\Zip\Zip class only use Zip is made to handle a zip file.


### Basic operations

- Open zip file:

    ```php    
    $zip = Zip::open('file.zip');

Additional methods

ZipManager usage

The \ZanySoft\Zip\ZipManager can handle multiple ZanySoft\Zip\Zip objects.

Basic operations

Additional methods