Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Laravel Mobile Pass Laravel Package

spatie/laravel-mobile-pass

Laravel package to generate Apple Wallet mobile passes (boarding passes, tickets, coupons, cards) with support for pushing updates to issued passes so they stay current on users’ devices. In development—don’t use in production yet.

View on GitHub
Deep Wiki
Context7

title: Downloading passes weight: 6

The easiest way to download a pass is by returning a MobilePass model and return it from a controller.

class YourController
{
    public function __invoke()
    {
        $pass = MobilePass::find(1);
        
        return $pass;
    }
}

This will return a response with the pass file and the correct headers to make it downloadable. The name of the pass will be pass.pkpass by default. You can change the name of the pass by specifying a download name when creating the mobile pass.

// Step 1: Create a pass
$mobilePass = AirlinePassBuilder::make()
    ->setDownloadName('boarding-pass-john-doe-to-london');
    ->setOrganisationName('My organisation')
    -> ... // other pass properties
    ->save();
 

// Step 2: in your controller return that mobile pass 


class YourController
{
    public function __invoke()
    {
        $pass = MobilePass::find(1);
        
        // the name of the downloaded pass will be `boarding-pass-john-doe-to-london.pkpass` 
        return $mobilePass;
    }
}

You can also specify the download name when returning the pass from a controller.

// in your controller

// the name of the downloaded pass will be `custom-pass-download-name.pkpass` 
$pass->download('custom-pass-download-name');
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
davejamesmiller/laravel-breadcrumbs
artisanry/parsedown
christhompsontldr/phpsdk
enqueue/dsn
bunny/bunny
enqueue/test
enqueue/null
enqueue/amqp-tools
milesj/emojibase
bower-asset/punycode
bower-asset/inputmask
bower-asset/jquery
bower-asset/yii2-pjax
laravel/nova
spatie/laravel-mailcoach
spatie/laravel-superseeder
laravel/liferaft
nst/json-test-suite
danielmiessler/sec-lists
jackalope/jackalope-transport