PHPackages                             aerni/zipper - 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. aerni/zipper

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

aerni/zipper
============

Zip your Statamic assets on the fly

v2.5.0(1mo ago)19761MITPHPPHP ^8.3CI passing

Since Oct 16Pushed 1mo ago1 watchersCompare

[ Source](https://github.com/aerni/statamic-zipper)[ Packagist](https://packagist.org/packages/aerni/zipper)[ Docs](https://github.com/aerni/statamic-zipper)[ RSS](/packages/aerni-zipper/feed)WikiDiscussions master Synced 1w ago

READMEChangelog (10)Dependencies (14)Versions (21)Used By (0)

[![Statamic](https://camo.githubusercontent.com/ed84414a56c4103f1be80b0aef8a041422eeac40e3785ea1bd10076723566c7b/68747470733a2f2f666c61742e62616467656e2e6e65742f62616467652f53746174616d69632f342e302b2f464632363945)](https://camo.githubusercontent.com/ed84414a56c4103f1be80b0aef8a041422eeac40e3785ea1bd10076723566c7b/68747470733a2f2f666c61742e62616467656e2e6e65742f62616467652f53746174616d69632f342e302b2f464632363945) [![Packagist version](https://camo.githubusercontent.com/197dc327cdb53240835f8d01a1cfc528908a5774c151dc0fc0812683c633b199/68747470733a2f2f666c61742e62616467656e2e6e65742f7061636b61676973742f762f6165726e692f7a69707065722f6c6174657374)](https://camo.githubusercontent.com/197dc327cdb53240835f8d01a1cfc528908a5774c151dc0fc0812683c633b199/68747470733a2f2f666c61742e62616467656e2e6e65742f7061636b61676973742f762f6165726e692f7a69707065722f6c6174657374) [![Packagist Total Downloads](https://camo.githubusercontent.com/746e388d6b5dd06b58f2a82135885c0ca20ecb1aa28a21ad56843c4f4c2b893e/68747470733a2f2f666c61742e62616467656e2e6e65742f7061636b61676973742f64742f6165726e692f7a6970706572)](https://camo.githubusercontent.com/746e388d6b5dd06b58f2a82135885c0ca20ecb1aa28a21ad56843c4f4c2b893e/68747470733a2f2f666c61742e62616467656e2e6e65742f7061636b61676973742f64742f6165726e692f7a6970706572)

Zipper
======

[](#zipper)

This addon provides a simple way to zip your Statamic assets on the fly.

Installation
------------

[](#installation)

Install the addon using Composer:

```
composer require aerni/zipper
```

Publish the config of the package (optional):

```
php please vendor:publish --tag=zipper-config
```

Basic Usage
-----------

[](#basic-usage)

To create a zip of your assets, you must call the `zip` tag followed by the `variable` containing your assets. The tag returns the URL to the route that handles creating the zip. The zip will be streamed without being saved to disk, but you may opt-in to save the file to disk for later use.

Somewhere in your content files:

```
images:
  - sega-genesis.jpg
  - snes.jpg
```

Somewhere in your views:

```
{{ zip:images }}
```

### Filename

[](#filename)

You may optionally pass a filename using the `filename` parameter. The filename defaults to the current timestamp when the Zip object is created. The example below binds the zip name to the page title.

```
{{ zip:images :filename="title" }}
```

### Link Expiry

[](#link-expiry)

If you want to expire your links after a certain time, you can either set the expiry globally in the config or use the `expiry` parameter on the tag. The expiry is to be set in minutes. Note that the expiry on the tag will override the expiry in the config.

```
{{ zip:images expiry="60" }}
```

Cleanup Old References
----------------------

[](#cleanup-old-references)

Zipper saves an encrypted instance of the Zip class every time it returns a URL. This class is later retrieved and decrypted when a user downloads a zip. These reference files are stored in `storage/zipper/{id}`.

With time, the number of saved reference files will grow. To control this, Zipper provides a scheduled command that will delete old reference files daily. Just make sure that your Scheduler is running.

### Cleanup Scopes

[](#cleanup-scopes)

There are a couple of cleanup scopes to choose from in the config.:

OptionDescription`expired`Only delete expired references files. This only affects references of zips that used the `expiry` option`all`Delete all reference files, excluding unexpired files. This will delete references of expired zips and zips that didn't use the expiry option. It will not delete unexpired zips.`force`Delete all reference files, including unexpired files. This will completely wipe all references.### Clean Command

[](#clean-command)

You may also use the `clean` command to delete reference files at your will. The scope defaults to `expired`.

```
php please zipper:clean
php please zipper:clean --scope=all
php please zipper:clean --scope=force
```

Advanced Usage
--------------

[](#advanced-usage)

You may also use this addon programmatically, as shown below.

```
use Aerni\Zipper\Zip;

// Prepare an array of Statamic assets, paths, or URLs.
$files = [
    Statamic\Assets\Asset,
    '/home/ploi/site.com/storage/app/assets/file_1.jpg',
    'https://site.com/path/to/file_2.jpg',
];

// Make a zip with the files above.
$zip = Zip::make($files);

// Set an optional filename. This defaults to the timestamp when the object was created.
$zip->filename('obi-wan-kenobi');

// Set an optional expiry time in minutes. This defaults to the expiry set in the config.
$zip->expiry(60);

// Get the URL that handles creating the zip.
$zip->url();

// Create a new zip or download a previously cached zip.
$zip->get();
```

###  Health Score

52

—

FairBetter than 96% of packages

Maintenance89

Actively maintained with recent releases

Popularity18

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity78

Established project with proven stability

 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 ~110 days

Recently: every ~270 days

Total

19

Last Release

54d ago

Major Versions

v1.7.1 → v2.0.02022-12-11

PHP version history (5 changes)v1.0.0PHP ^7.4

v1.3.0PHP ^7.4 || ^8.0

v1.5.0PHP ^8.0

v2.4.0PHP ^8.2

v2.5.0PHP ^8.3

### Community

Maintainers

![](https://www.gravatar.com/avatar/7f0a168dc347e5e141dc13cec734d3b0a25a13445069483732580f26f71456a6?d=identicon)[aerni](/maintainers/aerni)

---

Top Contributors

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

---

Tags

statamicstatamic-addonzipstatamiczipper

###  Code Quality

TestsPest

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/aerni-zipper/health.svg)

```
[![Health](https://phpackages.com/badges/aerni-zipper/health.svg)](https://phpackages.com/packages/aerni-zipper)
```

###  Alternatives

[maennchen/zipstream-php

ZipStream is a library for dynamically streaming dynamic zip files from PHP without writing to the disk at all on the server.

1.9k286.3M147](/packages/maennchen-zipstream-php)[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)[statamic/statamic

Statamic

824170.4k](/packages/statamic-statamic)[zanysoft/laravel-zip

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

3142.8M15](/packages/zanysoft-laravel-zip)[wapmorgan/unified-archive

UnifiedArchive - an archive manager with unified interface of working with all popular archive formats (zip/7z/rar/gz/bz2/xz/cab/tar/tar.gz/tar.bz2/tar.x/tar.Z/...) for PHP with ability for listing, reading, extracting and creation + built-in console archive manager.

2791.6M7](/packages/wapmorgan-unified-archive)[league/flysystem-ziparchive

ZIP filesystem adapter for Flysystem.

1039.3M58](/packages/league-flysystem-ziparchive)

PHPackages © 2026

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