Laravel Mobile Pass: Generate Apple Wallet and Google Wallet Passes

Published on by

Laravel Mobile Pass: Generate Apple Wallet and Google Wallet Passes image

Laravel Mobile Pass is a new package from Spatie (in collaboration with Dan Johnson) that generates mobile wallet passes for Apple Wallet and Google Wallet. It covers boarding passes, event tickets, coupons, store cards, membership cards, and gift cards—and can push live updates to passes already installed on user devices.

A Single Builder API for Both Platforms

The package gives Apple and Google passes a consistent builder interface. Here's an event ticket for Apple Wallet:

use Spatie\LaravelMobilePass\Builders\Apple\EventTicketPassBuilder;
 
$mobilePass = EventTicketPassBuilder::make()
->setOrganizationName('Fab Four Promotions')
->setSerialNumber('BTL-SHEA-0042')
->setDescription('The Beatles at Shea Stadium')
->addField('event', 'Beatles Live at Shea')
->addField('attendee', 'John Lennon', label: 'Name')
->addField('seat', 'Floor A, Row 12')
->save();

Google Wallet follows the same pattern with one extra step—declaring a Class (a reusable template) before creating individual passes:

use Spatie\LaravelMobilePass\Builders\Google\EventTicketPassBuilder;
use Spatie\LaravelMobilePass\Enums\BarcodeType;
 
$mobilePass = EventTicketPassBuilder::make()
->setClass('beatles-shea-1965')
->setAttendeeName('John Lennon')
->setSection('Floor A')
->setRow('12')
->setSeat('24')
->setBarcode(BarcodeType::Qr, 'TICKET-12345')
->save();

save() returns a MobilePass Eloquent model that implements Laravel's Responsable interface. Return it directly from a controller and the package serves the right format for each platform—a .pkpass file for Apple, a redirect to Google Wallet for Android.

Live Pass Updates

Once a pass is installed on a device, you can push changes to it. For Apple Wallet, call updateField on the MobilePass model:

$mobilePass->updateField('seat', '13A');

You can also include a notification message when the value changes:

$mobilePass->updateField(
'seat',
'13A',
changeMessage: 'Your seat was changed to :value',
);

Google Wallet updates work by modifying the content array and saving:

$content = $mobilePass->content;
$content['googleObjectPayload']['ticketHolderName'] = 'John Winston Lennon';
 
$mobilePass->update(['content' => $content]);

Updates are dispatched through a PushPassUpdateJob, which runs synchronously by default. Set MOBILE_PASS_QUEUE_CONNECTION in your environment to send them through a queue instead.

Multiple Pass Types

Beyond event tickets, the package includes builders for boarding passes (airline and other transit), coupons, store cards, membership cards, and gift cards. The AirlinePassBuilder handles flight-specific fields like departure and destination codes, passenger name, and seat:

use Spatie\LaravelMobilePass\Builders\Apple\AirlinePassBuilder;
use Spatie\LaravelMobilePass\Builders\Apple\Entities\Seat;
 
AirlinePassBuilder::make()
->setOrganizationName('Etihad')
->setDepartureAirportCode('AUH')
->setDestinationAirportCode('LHR')
->setPassengerName('Paul McCartney')
->setSeats(Seat::make(number: '12A'))
->save();

For trains, buses, or boats, extend the BoardingPassBuilder and set the appropriate TransitType.

Boarding pass
Generated boarding pass example

Try the Live Demo

Spatie has a live demo where you can generate every pass type, install it on an iPhone, and trigger a live update to see the push mechanism in action. The demo source is available at spatie/laravel-mobile-pass-demo.

Check out the GitHub repository for installation instructions, Apple and Google credential setup, and full documentation.

Paul Redmond photo

Staff writer at Laravel News. Full stack web developer and author.

Cube

Laravel Newsletter

Join 40k+ other developers and never miss out on new tips, tutorials, and more.

image
SerpApi

The Web Search API for Your LLM and AI Applications

Visit SerpApi
Tinkerwell logo

Tinkerwell

The must-have code runner for Laravel developers. Tinker with AI, autocompletion and instant feedback on local and production environments.

Tinkerwell
No Compromises logo

No Compromises

Joel and Aaron, the two seasoned devs from the No Compromises podcast, are now available to hire for your Laravel project. ⬧ Flat rate of $9500/mo. ⬧ No lengthy sales process. ⬧ No contracts. ⬧ 100% money back guarantee.

No Compromises
Shift logo

Shift

Running an old Laravel version? Instant, automated Laravel upgrades and code modernization to keep your applications fresh.

Shift
Kirschbaum logo

Kirschbaum

Providing innovation and stability to ensure your web application succeeds.

Kirschbaum
Harpoon: Next generation time tracking and invoicing logo

Harpoon: Next generation time tracking and invoicing

The next generation time-tracking and billing software that helps your agency plan and forecast a profitable future.

Harpoon: Next generation time tracking and invoicing
Acquaint Softtech logo

Acquaint Softtech

Acquaint Softtech offers AI-ready Laravel developers who onboard in 48 hours at $3000/Month with no lengthy sales process and a 100 percent money-back guarantee.

Acquaint Softtech
Laravel Cloud logo

Laravel Cloud

Easily create and manage your servers and deploy your Laravel applications in seconds.

Laravel Cloud
SaaSykit: Laravel SaaS Starter Kit logo

SaaSykit: Laravel SaaS Starter Kit

SaaSykit is a Multi-tenant Laravel SaaS Starter Kit that comes with all features required to run a modern SaaS. Payments, Beautiful Checkout, Admin Panel, User dashboard, Auth, Ready Components, Stats, Blog, Docs and more.

SaaSykit: Laravel SaaS Starter Kit
PhpStorm logo

PhpStorm

The go-to PHP IDE with extensive out-of-the-box support for Laravel and its ecosystem.

PhpStorm
Lucky Media logo

Lucky Media

Get Lucky Now - the ideal choice for Laravel Development, with over a decade of experience!

Lucky Media

The latest

View all →
First-Party Image Processing in Laravel 13.20 image

First-Party Image Processing in Laravel 13.20

Read article
Laravel Legacy Bridge: Carry Authenticated Sessions from a Legacy App into Laravel image

Laravel Legacy Bridge: Carry Authenticated Sessions from a Legacy App into Laravel

Read article
Laravel Quota: Usage Budgets for Calendar Periods image

Laravel Quota: Usage Budgets for Calendar Periods

Read article
Find the Security Vulnerabilities in Your Laravel App with Sensagraph image

Find the Security Vulnerabilities in Your Laravel App with Sensagraph

Read article
Uvora: A macOS Menu Bar App for Finding Laravel Projects image

Uvora: A macOS Menu Bar App for Finding Laravel Projects

Read article
Passwordless Sign-In with Fortify Two-Factor Support in Laravel image

Passwordless Sign-In with Fortify Two-Factor Support in Laravel

Read article