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
Laravel Cloud

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

Visit Laravel Cloud
Shift logo

Shift

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

Shift
Tinkerwell logo

Tinkerwell

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

Tinkerwell
PhpStorm logo

PhpStorm

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

PhpStorm
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
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
Kirschbaum logo

Kirschbaum

Providing innovation and stability to ensure your web application succeeds.

Kirschbaum
Lucky Media logo

Lucky Media

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

Lucky Media
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
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
Laravel Cloud logo

Laravel Cloud

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

Laravel Cloud

The latest

View all →
Route Metadata Support in Laravel 13.17 image

Route Metadata Support in Laravel 13.17

Read article
Ship AI with Laravel: Failover, Queues, and Middleware for AI Agents image

Ship AI with Laravel: Failover, Queues, and Middleware for AI Agents

Read article
Monitor and Control Schedules, Queues, and Errors in Laravel with Watchtower image

Monitor and Control Schedules, Queues, and Errors in Laravel with Watchtower

Read article
Showcase Your PhpStorm Expertise on LinkedIn image

Showcase Your PhpStorm Expertise on LinkedIn

Read article
Privacy Filter: Detect PII in Text from Laravel image

Privacy Filter: Detect PII in Text from Laravel

Read article
NationForge: A Self-Hosted Admin Panel for Civic Organizations image

NationForge: A Self-Hosted Admin Panel for Civic Organizations

Read article