PHPackages                             webikevn/laravel-zip - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [File &amp; Storage](/categories/file-storage)
4. /
5. webikevn/laravel-zip

ActiveLibrary[File &amp; Storage](/categories/file-storage)

webikevn/laravel-zip
====================

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

1.0.1(5y ago)159MITPHPPHP &gt;=5.6.0

Since Aug 19Pushed 5y ago1 watchersCompare

[ Source](https://github.com/webikevn/laravel-zip)[ Packagist](https://packagist.org/packages/webikevn/laravel-zip)[ RSS](/packages/webikevn-laravel-zip/feed)WikiDiscussions master Synced today

READMEChangelog (2)Dependencies (2)Versions (3)Used By (0)

webikevn/laravel-zip
====================

[](#webikevnlaravel-zip)

> 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](http://php.net/manual/en/class.ziparchive.php).

### Installation

[](#installation)

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

```
composer require webikevn/laravel-zip

```

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

```
Webike\Zip\ZipServiceProvider::class,

```

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

```
'Zip' => Webike\Zip\ZipFacade::class,

```

Zip usage
---------

[](#zip-usage)

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

- include the Zip class at top:

```
use Zip;
```

### Basic operations

[](#basic-operations)

- Open zip file:

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

    ```
    $zip = Zip::create('file.zip');
    ```
- Check zip file:

    ```
    $is_valid = Zip::check('file.zip');
    ```
- Extract zip file:

    ```
    // extract whole archive
    $zip->extract('/path/to/uncompressed/files');

    // extract a file
    $zip->extract('/path/to/uncompressed/files', 'file');

    // extract multiple files
    $zip->extract('/path/to/uncompressed/files', array('file1','file2'));
    ```
- Check if zip has a file:

    ```
    // Check if archive has a file
    $zip->has('/path/to/file/in/archive');

    // Check if archive has a file case insensitively
    $zip->has('/path/to/file/in/archive', ZipArchive::FL_NOCASE);

    // Check if archive has a file ignoring directory component
    $zip->has('file', ZipArchive::FL_NODIR);

    // Check if archive has a file case insensitively ignoring directory component
    $zip->has('file', ZipArchive::FL_NOCASE|ZipArchive::FL_NODIR);
    ```
- Add a file/directory to zip:

    ```
    $zip->add('/path/to/my/file');

    // declaring path
    $zip->setPath('/path/to/my')->add('file');

    // add directory
    $zip->add('/path/to/my/directory');

    // add directory (only its content)
    $zip->add('/path/to/my/directory', true);
    ```
- Add multiple files/directories to zip:

    ```
    // using array as parameter
    $zip->add( array('/path/to/my/file1', '/path/to/my/file2');

    // chaining methods
    $zip->add('/path/to/my/file1')->add('/path/to/my/file2');

    // declaring path
    $zip->setPath('/path/to/my')->add('file1')->add('file2');
    ```
- Delete a file/directory from zip:

    ```
    $zip->delete('file');
    ```
- Delete multiple files/directories from zip:

    ```
    // using array as parameter
    $zip->delete( array('file1', 'file2') );

    // chaining methods
    $zip->delete('file1')->delete('file2');
    ```
- List content of zip file

    ```
    $zip->listFiles();
    ```
- Close zip file

    ```
    $zip->close();
    ```

### Additional methods

[](#additional-methods)

- Skip hidden files while adding directories:

    ```
    // set mode
    $zip->setSkipped('HIDDEN');

    // get mode
    $mode = $zip->getSkipped();
    ```
- Use password for zip extraction:

    ```
    // set password
    $zip->setPassword('slartibartfast');

    // get password
    $password = $zip->getPassword();
    ```
- Use a mask != 0777 for created folders:

    ```
    // set mask
    $zip->setMask(0644);

    // get mask
    $mask = $zip->getMask();
    ```

ZipManager usage
----------------

[](#zipmanager-usage)

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

- include the Zip and ZipManager class at top:

```
use ZanySoft\Zip\ZipManager;
use Zip;
```

### Basic operations

[](#basic-operations-1)

- Init the manager and register Zips:

    ```
    // init manager
    $manager = new ZipManager();

    // register existing zips
    $manager->addZip( Zip::open('/path/to/my/file1.zip') )
            ->addZip( Zip::open('/path/to/my/file2.zip') );

    // register a new zip
    $manager->addZip( Zip::create('/path/to/my/file3.zip') );
    ```
- Basic zips management:

    ```
    // get a list of registered zips
    $list = $manager->listZips();

    // remove a zip
    $manager->removeZip($ZipObject);

    // get a Zip
    $zip = $manager->getZip(0);
    ```
- Add files to all zips:

    ```
    $manager-> = new ZipManager();

    // register existing zips
    $manager->addZip( Zip::open('/path/to/my/file1.zip') )
            ->addZip( Zip::open('/path/to/my/file2.zip') );

    // register a new zip
    $manager->addZip( Zip::create('/path/to/my/file3.zip') );
    ```
- Extract zips:

    ```
    // separate content in folders
    $extract = $manager->extract('/path/to/uncompressed/files', true);

    // use a single folder
    $extract = $manager->extract('/path/to/uncompressed/files', false);

    // extract single file
    $extract = $manager->extract('/path/to/uncompressed/files', false, 'file');

    // extract multiple files
    $extract = $manager->extract('/path/to/uncompressed/files', false, array('file1','file2'));
    ```
- Merge zips:

    ```
    // separate content in folders
    $manager->merge('/path/to/output/file.zip', true);

    // flatten files
    $manager->merge('/path/to/output/file.zip', false);
    ```
- Close zips:

    ```
    $manager->close();
    ```

### Additional methods

[](#additional-methods-1)

- Declare path from which add files:

    ```
    // set path
    $zip->setPath('/path/to/files');

    // get path
    $path = $zip->getPath();
    ```
- Use a mask != 0777 for created folders

    ```
    // set masks
    $manager->setMask(0644);

    // get masks
    $mask = $manager->getMask();
    ```

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity51

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

2

Last Release

2090d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/09f7d0bae763e995aa8b55c06da4a631819fc5e7acf10f1aa4a17e1ea8ab0fd8?d=identicon)[giangbeoit](/maintainers/giangbeoit)

---

Top Contributors

[![GiangBeo](https://avatars.githubusercontent.com/u/3804842?v=4)](https://github.com/GiangBeo "GiangBeo (4 commits)")

---

Tags

laravelbackupzipextractmergelaravel5ziparchivemultipleunziplaravel-zip

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/webikevn-laravel-zip/health.svg)

```
[![Health](https://phpackages.com/badges/webikevn-laravel-zip/health.svg)](https://phpackages.com/packages/webikevn-laravel-zip)
```

###  Alternatives

[zanysoft/laravel-zip

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

3142.8M15](/packages/zanysoft-laravel-zip)[nelexa/zip

PhpZip is a php-library for extended work with ZIP-archives. Open, create, update, delete, extract and get info tool. Supports appending to existing ZIP files, WinZip AES encryption, Traditional PKWARE Encryption, BZIP2 compression, external file attributes and ZIP64 extensions. Alternative ZipArchive. It does not require php-zip extension.

4967.4M112](/packages/nelexa-zip)[madnest/madzipper

Easier zip file handling for Laravel applications.

1382.3M6](/packages/madnest-madzipper)[splitbrain/php-archive

Pure-PHP implementation to read and write TAR and ZIP archives

1061.4M20](/packages/splitbrain-php-archive)[raulfraile/distill

Smart compressed files extractor

228190.4k9](/packages/raulfraile-distill)[oneduo/nova-file-manager

A handy file manager tool for Laravel Nova

157350.3k2](/packages/oneduo-nova-file-manager)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
