Polyscope - The agent-first dev environment for Laravel

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
Get expert guidance in a few days with a Laravel code review logo

Get expert guidance in a few days with a Laravel code review

Expert code review! Get clear, practical feedback from two Laravel devs with 10+ years of experience helping teams build better apps.

Get expert guidance in a few days with a Laravel code review
PhpStorm logo

PhpStorm

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

PhpStorm
Laravel Cloud logo

Laravel Cloud

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

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

Kirschbaum

Providing innovation and stability to ensure your web application succeeds.

Kirschbaum
Shift logo

Shift

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

Shift
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
Lucky Media logo

Lucky Media

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

Lucky Media
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
MongoDB logo

MongoDB

Enhance your PHP applications with the powerful integration of MongoDB and Laravel, empowering developers to build applications with ease and efficiency. Support transactional, search, analytics and mobile use cases while using the familiar Eloquent APIs. Discover how MongoDB's flexible, modern database can transform your Laravel applications.

MongoDB

The latest

View all →
Laravel Mobile Pass: Generate Apple Wallet and Google Wallet Passes image

Laravel Mobile Pass: Generate Apple Wallet and Google Wallet Passes

Read article
PHPverse 2026 Returns June 9th image

PHPverse 2026 Returns June 9th

Read article
LLPhant: A PHP Generative AI Framework Inspired by LangChain image

LLPhant: A PHP Generative AI Framework Inspired by LangChain

Read article
Debounceable Queued Jobs in Laravel 13.6.0 image

Debounceable Queued Jobs in Laravel 13.6.0

Read article
Build Custom Middleware for Query Performance Monitoring and Optimization in Laravel with MongoDB image

Build Custom Middleware for Query Performance Monitoring and Optimization in Laravel with MongoDB

Read article
Laravel API Starter Kits Are Coming Soon! image

Laravel API Starter Kits Are Coming Soon!

Read article