The passgenerator package is a Laravel library designed to generate Apple Wallet (formerly Passbook) compatible passes. It provides a fluent interface for defining pass properties (such as description, format, organization details) and supports various pass types including boarding passes, coupons, event tickets, generic passes, and store cards. The package handles the complex process of creating the pass.json manifest, signing it with a certificate using OpenSSL, and packaging all components into a secure .pkpass file. At its core, the package centers around the PassGenerator class which manages the creation process: setting up certificates, creating temporary directories, generating SHA-1 hashes for the manifest, signing the manifest, and zipping the final package. It leverages Laravel's filesystem abstraction for file operations and configuration management. The package also includes a rich set of definition classes that allow developers to programmatically construct passes using a builder pattern, with built-in validation against Apple's specifications for fields, barcodes, locations, and other pass elements. The package requires proper configuration of Apple certificates (a .p12 file and the WWDR certificate) and integrates seamlessly with Laravel applications via a service provider and facade. It is suitable for any Laravel application needing to issue digital passes for events, tickets, coupons, or loyalty programs.
This repository is a PHP library for creating Apple Wallet passes (.pkpass files) and related functionality. It provides classes to generate, sign, and package passes according to Apple's Wallet specifications, including support for boarding passes, store cards, event tickets, and financial orders. The library handles certificate-based signing, file inclusion, localization, and pass creation through a clean object-oriented interface. The architecture centers around the PKPass class which implements the core pass creation logic, including manifest generation, signature creation using OpenSSL, and ZIP packaging. FinanceOrder extends PKPass for financial transaction orders with order-specific constants and SHA-256 hashing. PKPassBundle enables combining multiple passes into a single .pkpasses file for bulk distribution. The Push class handles Apple Push Notification Service (APNS) integration for sending pass updates to devices. Key features include flexible data input (arrays or JSON strings), file management (local, remote, and string content), localization support, and proper error handling through custom exceptions. The library requires PHP 7.0+ with ZIP, JSON, and OpenSSL extensions, and includes comprehensive testing via PHPUnit.