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. laulamanapps/apple-passbook

ActiveLibrary

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

Generate Apple Passbooks from PHP

v1.1.4(4y ago)7147.3k—1.5%4[3 issues](https://github.com/LauLamanApps/apple-passbook/issues)[1 PRs](https://github.com/LauLamanApps/apple-passbook/pulls)1MITPHPPHP ^7.4|^8.0

Since Dec 3Pushed 4y 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 1mo ago

READMEChangelog (8)Dependencies (3)Versions (11)Used By (1)

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

[](#apple-passbook)

This package provides a simple OOP integration of the [Apple Passbook 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 if your using Symfony install [laulamanapps/apple-passbook-bundle](https://github.com/LauLamanApps/apple-passbook-bundle):

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

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('', '');
```

AppleWWDRA certificate.
-----------------------

[](#applewwdra-certificate)

Included ar 2 AppleWWDRCA certificates:

- AppleWWDRCA.pem - *Expires feb 3 2023*
- AppleWWDRCAG3.pem - *Expires feb 20 2030*

By default AppleWWDRCA is used if you want to use the otherone you can do so by setting its file path as the 3rd option in the `CompilerFactory` or calling `setAppleWWDRCA()` on the `Signer` class for custom implementation

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);
```

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)
- [Coupon](docs/example/Coupon.php)
- [Event](docs/example/Event.php)
- [Generic](docs/example/Generic.php)
- [StoreCard](docs/example/StoreCard.php)

Credits
-------

[](#credits)

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

###  Health Score

37

—

LowBetter than 83% of packages

Maintenance11

Infrequent updates — may be unmaintained

Popularity39

Limited adoption so far

Community15

Small or concentrated contributor base

Maturity69

Established project with proven stability

 Bus Factor1

Top contributor holds 96.1% 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 ~102 days

Recently: every ~123 days

Total

8

Last Release

1638d ago

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

v1.1PHP &gt;=7.3

v1.1.2PHP ^7.4|^8.0

### 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 (49 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

### 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

9733.0M6](/packages/pkpass-pkpass)[eo/passbook

iOS Passbook for PHP

2651.6M2](/packages/eo-passbook)[griffinledingham/php-apple-signin

A simple library to decode and parse Apple Sign In client tokens.

2011.9M1](/packages/griffinledingham-php-apple-signin)[thenextweb/passgenerator

A Laravel package to create Apple Wallet (old Passbook) compatible tickets.

297435.6k](/packages/thenextweb-passgenerator)[chiiya/passes

PHP library for creating iOS and Android Wallet Passes

67243.1k1](/packages/chiiya-passes)[byte5/laravel-passgenerator

A Laravel package to create Apple Wallet (old Passbook) compatible tickets.

8821.3k](/packages/byte5-laravel-passgenerator)

PHPackages © 2026

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