spatie/laravel-mobile-pass
Generate Apple Wallet and Google Wallet passes in Laravel (tickets, boarding passes, coupons, membership cards). Create and sign pass files, serve them to users, and push updates to installed passes to keep details current across devices.
MobilePass model and associated builders (BoardingPass, EventTicket, Loyalty, etc.) align well with DDD principles, allowing for clear separation of concerns between pass types and business logic.GoogleMobilePassSaved, GoogleMobilePassRemoved) and queue jobs (PushPassUpdateJob) for asynchronous pass updates, reducing latency and improving scalability.spatie/array-to-xml, spatie/google-wallet). Integration requires:
mobile_passes table (or custom table via config).MobilePass model via mobile-pass.models.mobile_pass config.EventTicketPassBuilder) for custom fields or logic.CreatingMobilePass, UpdatingMobilePass) for pre/post-processing..p12) for signing .pkpass files. Misconfiguration (e.g., expired certs) can break pass generation.InvalidConfig::webserviceHostMustBeHttps).pass_serial (added in v1.0.5), requiring careful handling of duplicate/conflicting serials.ECv2SigningOnly verification (updated in v1.2.0). Incorrect JWKS configuration can fail pass updates.MOBILE_PASS_QUEUE_CONNECTION) help mitigate this.pass_serial (see UPGRADING.md). Existing deployments must backfill this field.MobilePass or use the default model for pass metadata (e.g., user_id, pass_type, serial).PushPassUpdateJob for async updates (requires MOBILE_PASS_QUEUE_CONNECTION config).GoogleMobilePassSaved/GoogleMobilePassRemoved for custom logic (e.g., notifications).addToWalletUrl() to generate platform-specific download links (e.g., /mobile-pass/{pass}/download for Apple, deep links for Google)..p12) and pass type IDs (e.g., com.example.boardingpass) from Apple Developer Portal.addToWallet() WebKit API or a download link.composer require spatie/laravel-mobile-pass
php artisan vendor:publish --provider="Spatie\MobilePass\MobilePassServiceProvider"
php artisan migrate
config/mobile-pass.php) and update:
apple.certificate_path (path to .p12 file).apple.pass_type_identifiers (e.g., ['boardingpass' => 'com.example.boardingpass']).google.service_account_key_path (path to Google service account JSON).mobile_pass model (if customizing).php artisan migrate to create the mobile_passes table.pass_serial to existing records (see UPGRADING.md).MobilePass model and basic pass generation (e.g., BoardingPass).PushPassUpdateJob) for async updates.config/mobile-pass.php accordingly.openssl pkcs12 -info -in path/to/cert.p12.google.service_account_key_path.mobile_passes table (contains user-sensitive data like pass serials).spatie/mobile-pass logs for:
webServiceURL is HTTPS and pass_serial is unique.ECv2SigningOnly config.How can I help you explore Laravel packages today?