PHPackages                             laulamanapps/apple-passbook - 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. [PDF &amp; Document Generation](/categories/documents)
4. /
5. laulamanapps/apple-passbook

ActiveLibrary[PDF &amp; Document Generation](/categories/documents)

laulamanapps/apple-passbook
===========================

Generate Apple Wallet (previously Passbook) compatible tickets from PHP

v2.0.1(1mo ago)8153.9k↓43.5%45MITPHPPHP ^8.1CI passing

Since Dec 3Pushed 1mo ago1 watchersCompare

[ Source](https://github.com/LauLamanApps/apple-passbook)[ Packagist](https://packagist.org/packages/laulamanapps/apple-passbook)[ RSS](/packages/laulamanapps-apple-passbook/feed)WikiDiscussions master Synced 2w ago

READMEChangelog (9)Dependencies (6)Versions (14)Used By (5)

Apple Passbook
==============

[](#apple-passbook)

This package provides a simple OOP integration of the [Apple Wallet passes (PassKit) API](https://developer.apple.com/documentation/passkit) for your PHP project.

[![GithubCi](https://github.com/LauLamanApps/apple-passbook/workflows/CI/badge.svg)](https://github.com/LauLamanApps/apple-passbook/actions?query=workflow%3ACI)[![Build Status](https://camo.githubusercontent.com/d2525f3f3e3e30166c1904224e369439e0f825c7173e99a24a7292060642ade2/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f4c61754c616d616e417070732f6170706c652d70617373626f6f6b2f6261646765732f6275696c642e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/LauLamanApps/apple-passbook/build-status/master)[![Code Coverage](https://camo.githubusercontent.com/6d85d2ce2de7ff6f6300c2de8ac16395824a971c3ee49728e40b70f9fb8eec30/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f4c61754c616d616e417070732f6170706c652d70617373626f6f6b2f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/LauLamanApps/apple-passbook/?branch=master)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/b0558ff996b73f3d8de718cd88469e41cef6a7ef7d72740f25b0f1a585a6cef9/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f4c61754c616d616e417070732f6170706c652d70617373626f6f6b2f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/LauLamanApps/apple-passbook/?branch=master)[![Latest Stable Version](https://camo.githubusercontent.com/534dba30be9cfe13b47d20743dafc0d7637c5954a47745bb3187842d4f4be9fe/68747470733a2f2f706f7365722e707567782e6f72672f6c61756c616d616e617070732f6170706c652d70617373626f6f6b2f762f737461626c65)](https://packagist.org/packages/laulamanapps/apple-passbook)[![License](https://camo.githubusercontent.com/f8fa47e22a224944427dec2d8a273f3cc343b33419be572bafbc153dc23be0c0/68747470733a2f2f706f7365722e707567782e6f72672f6c61756c616d616e617070732f6170706c652d70617373626f6f6b2f6c6963656e7365)](https://packagist.org/packages/laulamanapps/apple-passbook)

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

[](#installation)

With [composer](http://packagist.org), add:

```
$ composer require laulamanapps/apple-passbook
```

Or use one of the framework integrations, which also implement the Apple PassKit web service endpoints for pass updates:

If you're using **Symfony**, install [laulamanapps/apple-passbook-bundle](https://github.com/LauLamanApps/apple-passbook-bundle):

```
$ composer require laulamanapps/apple-passbook-bundle
```

If you're using **Laravel**, install [laulamanapps/apple-passbook-laravel](https://github.com/LauLamanApps/apple-passbook-laravel):

```
$ composer require laulamanapps/apple-passbook-laravel
```

Run Tests
---------

[](#run-tests)

We use [act](https://github.com/nektos/act) to run tests which runs github actions locally:

```
$ act -P ubuntu-latest=shivammathur/node:latest
```

Get certificate
---------------

[](#get-certificate)

Head over to the [Apple Developer Portal](https://developer.apple.com/account/resources/certificates/list) to get yourself a certificate to sign your passbooks with.

[Convert](docs/certificate.md) the certificate and key to a .p12 file using the **Keychain Access**

Setup Compiler
--------------

[](#setup-compiler)

```
use LauLamanApps\ApplePassbook\Build\CompilerFactory;

$factory = new CompilerFactory();
$compiler = $factory->getCompiler('', '');
```

AppleWWDRCA certificate.
------------------------

[](#applewwdrca-certificate)

Included are 4 AppleWWDRCA intermediate certificates:

- AppleWWDRCAG3.pem - *Expires Feb 20 2030* (fallback default)
- AppleWWDRCAG4.pem - *Expires Dec 10 2030*
- AppleWWDRCAG5.pem - *Expires Dec 10 2030*
- AppleWWDRCAG6.pem - *Expires Mar 19 2036*

The `Signer` automatically selects the bundled intermediate that matches the issuer of your pass type identifier certificate (G3–G6), so in most cases no configuration is needed. To override the selection, set a file path as the 3rd option of the `CompilerFactory`or call `setAppleWWDRCA()` on the `Signer` class.

Create Passbook
---------------

[](#create-passbook)

```
use LauLamanApps\ApplePassbook\EventTicketPassbook;
use LauLamanApps\ApplePassbook\MetaData\Barcode;
use LauLamanApps\ApplePassbook\MetaData\Field\Field;
use LauLamanApps\ApplePassbook\MetaData\Image\LocalImage;
use LauLamanApps\ApplePassbook\MetaData\Location;
use LauLamanApps\ApplePassbook\Style\BarcodeFormat;
use LauLamanApps\ApplePassbook\Style\Color\Rgb;

$passbook = new EventTicketPassbook('nmyuxofgna');
$passbook->setTeamIdentifier('');
$passbook->setPassTypeIdentifier('');
$passbook->setOrganizationName('Apple Inc.');
$passbook->setDescription('Apple Event Ticket');
$passbook->setRelevantDate(new DateTimeImmutable('2011-12-08T13:00-08:00'));
$passbook->setForegroundColor(new Rgb(255, 255, 255));
$passbook->setBackgroundColor(new Rgb(60, 65, 76));
$passbook->setWebService('https://example.com/passes/', 'vxwxd7J8AlNNFPS8k0a0FfUFtq0ewzFdc');

$passbook->addLocation(new Location(37.6189722, -122.3748889));
$passbook->addLocation(new Location(37.33182, -122.03118));

$barcode = new Barcode();
$barcode->setFormat(BarcodeFormat::Pdf417);
$barcode->setMessage('123456789');
$passbook->setBarcode($barcode);

$event = new Field();
$event->setKey('event');
$event->setLabel('EVENT');
$event->setValue('The Beat Goes On');
$passbook->addPrimaryField($event);

$loc = new Field();
$loc->setKey('loc');
$loc->setLabel('LOCATION');
$loc->setValue('Moscone West');
$passbook->addSecondaryField($loc);

$passbook->addImage(new LocalImage('/files/Event/background.png'));
$passbook->addImage(new LocalImage('/files/Event/icon.png'));
$passbook->addImage(new LocalImage('/files/Event/logo.png'));
$passbook->addImage(new LocalImage('/files/Event/thumbnail.png'));
```

Compile Passbook
----------------

[](#compile-passbook)

```
header('Content-Description: File Transfer');
header('Content-Type: application/vnd.apple.pkpass');
header('Content-Disposition: filename="boardingpass.pkpass"');

echo $compiler->compile($passbook);
```

Push Notifications (updating passes)
------------------------------------

[](#push-notifications-updating-passes)

When a pass is registered on a device via the [web service](https://developer.apple.com/documentation/walletpasses/adding-a-web-service-to-update-passes), Apple provides a push token. You can use the `Notifier` to send a push notification that tells the device to fetch an updated version of the pass.

```
use LauLamanApps\ApplePassbook\Build\Notifier;

// Using a .p12 certificate (as provided by Apple)
$notifier = new Notifier('', '');

// Or using a .pem certificate
$notifier = new Notifier('');

// Send a push notification to trigger a pass update
$notifier->notify('');
```

For sandbox/development environments:

```
use LauLamanApps\ApplePassbook\Build\ApnsEnvironment;

$notifier = new Notifier('', '', ApnsEnvironment::Sandbox);
```

> **Note:** The `ext-curl` extension with HTTP/2 support is required.

Examples
--------

[](#examples)

For the examples to work place the certificate P12 file in the `/certificates` folder and fill out the required information in the example scripts: ``, ``, ``

Example php scripts can be found in `docs/example`:

- [BoardingPass](docs/example/BoardingPass.php)
- [BoardingPass Advanced](docs/example/BoardingPassAdvanced.php) — semantic tags, action URLs, QR barcode, beacons
- [Coupon](docs/example/Coupon.php)
- [Event](docs/example/Event.php)
- [Event Advanced](docs/example/EventAdvanced.php) — semantic tags, action URLs, NFC, expiration, sharing
- [Generic](docs/example/Generic.php)
- [Generic NFC](docs/example/GenericNfc.php) — employee badge with NFC door access, beacons, Wi-Fi, data detectors
- [StoreCard](docs/example/StoreCard.php)
- [StoreCard NFC](docs/example/StoreCardNfc.php) — NFC-enabled loyalty card with contactless authentication
- [Push Notification](docs/example/PushNotification.php) — sending pass updates via APNs

Credits
-------

[](#credits)

This package has been developed by [LauLaman](https://github.com/LauLaman).

###  Health Score

60

—

FairBetter than 98% of packages

Maintenance92

Actively maintained with recent releases

Popularity39

Limited adoption so far

Community20

Small or concentrated contributor base

Maturity74

Established project with proven stability

 Bus Factor1

Top contributor holds 97.5% 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 ~240 days

Recently: every ~423 days

Total

11

Last Release

41d ago

Major Versions

v1.1.4 → 2.0.x-dev2026-06-09

PHP version history (4 changes)v1.0PHP &gt;=7.1

v1.1PHP &gt;=7.3

v1.1.2PHP ^7.4|^8.0

2.0.x-devPHP ^8.1

### Community

Maintainers

![](https://www.gravatar.com/avatar/930ca3b1756d00a63c8ff3363e81f16f961cf3ef79ff0c9d362670c36d97e456?d=identicon)[LauLaman](/maintainers/LauLaman)

---

Top Contributors

[![LauLaman](https://avatars.githubusercontent.com/u/8283992?v=4)](https://github.com/LauLaman "LauLaman (79 commits)")[![ercole79](https://avatars.githubusercontent.com/u/1193317?v=4)](https://github.com/ercole79 "ercole79 (1 commits)")[![noahlvb](https://avatars.githubusercontent.com/u/6873972?v=4)](https://github.com/noahlvb "noahlvb (1 commits)")

---

Tags

appleiospassbookphpphpappleiphonewalletiospassbookstore cardcouponevent ticketboarding passiPod Touchpkpass

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/laulamanapps-apple-passbook/health.svg)

```
[![Health](https://phpackages.com/badges/laulamanapps-apple-passbook/health.svg)](https://phpackages.com/packages/laulamanapps-apple-passbook)
```

###  Alternatives

[pkpass/pkpass

PHP PKPass class for iOS Wallet

9813.6M14](/packages/pkpass-pkpass)[leantime/leantime

Open source project management system for non-project managers. Simple like Trello, powerful like Jira. Built with neurodiversity in mind.

11.3k4.0k](/packages/leantime-leantime)[markocupic/calendar-event-booking-bundle

Contao Calendar Event Booking Bundle

125.3k1](/packages/markocupic-calendar-event-booking-bundle)

PHPackages © 2026

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