chiiya / laravel-passes
Laravel library for creating iOS and Android Wallet Passes
Fund package maintenance!
chiiya
Installs: 27 819
Dependents: 0
Suggesters: 0
Security: 0
Stars: 21
Watchers: 1
Forks: 7
Open Issues: 9
Requires
- php: ^8.1|^8.2
- chiiya/passes: ^1.0
- illuminate/contracts: ^9.0|^10.0|^11.0
- spatie/laravel-package-tools: ^1.11
Requires (Dev)
- chiiya/laravel-code-style: ^3.0
- nunomaduro/collision: ^6.1|^7.0|^8.0
- orchestra/testbench: ^7.1|^8.0|^9.0
- phpunit/phpunit: ^9.5|^10.0|^11.0
This package is auto-updated.
Last update: 2024-10-10 13:45:00 UTC
README
Laravel package for creating iOS and Android Wallet Passes.
Installation
You can install the package via composer:
composer require chiiya/laravel-passes
Publish the configuration files with:
php artisan vendor:publish --tag="passes-config"
Usage
This package is a thin wrapper around chiiya/passes, that allows you to directly
inject the Google repositories or Apple PassFactory
in your application:
public function __construct( private OfferClassRepository $offers, private PassFactory $apple, ) public function handle(): void { $this->apple->create(...); $this->offers->get(...); }
You may also use the PassBuilder
class, which is an entry point to all pass building functionalities and contains
a helper method for creating a signed Google JWT:
use Chiiya\LaravelPasses\PassBuilder; public function __construct( private PassBuilder $builder, ) public function handle(): void { $this->builder->apple()->create(...); $this->builder->google()->offerClasses()->create(...); $this->builder->google()->createJWT()->addOfferObject(...)->sign(); }
For documentation on method signatures, check out chiiya/passes.
Testing
Since this package uses the Laravel HTTP Client under the hood to perform API requests,
you may simply call Http::fake()
to fake responses in your tests. For mocking specific responses,
check out the example responses.
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.
License
The MIT License (MIT). Please see License File for more information.