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(3mo ago)19781MITPHPPHP ^8.3CI passing

Since Oct 16Pushed 3mo 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 3w 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

50

—

FairBetter than 95% of packages

Maintenance81

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

100d 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://avatars.githubusercontent.com/u/23167701?v=4)[Michael Aerni](/maintainers/aerni)[@aerni](https://github.com/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

[statamic-rad-pack/runway

Eloquently manage your database models in Statamic.

135224.7k7](/packages/statamic-rad-pack-runway)[statamic/cms

The Statamic CMS Core Package

4.8k3.6M985](/packages/statamic-cms)[statamic/statamic

Statamic

829179.5k](/packages/statamic-statamic)[duncanmcclean/statamic-cargo

Comprehensive e-commerce addon for Statamic. Build bespoke e-commerce sites without the complexity.

3416.9k](/packages/duncanmcclean-statamic-cargo)[marcorieser/statamic-livewire

A Laravel Livewire integration for Statamic.

23111.5k14](/packages/marcorieser-statamic-livewire)[aerni/livewire-forms

A Statamic forms framework powered by Laravel Livewire

2915.1k](/packages/aerni-livewire-forms)

PHPackages © 2026

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