Download the PHP package thenextweb/passgenerator without Composer
On this page you can find all versions of the php package thenextweb/passgenerator. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download thenextweb/passgenerator
More information about thenextweb/passgenerator
Files in thenextweb/passgenerator
Package passgenerator
Short Description A Laravel package to create Apple Wallet (old Passbook) compatible tickets.
License GPL-3.0-or-later
Informations about the package passgenerator
Passgenerator
Passgenerator is a Laravel7+ package that allows you to easily create passes compatible with Apple Wallet (former Passbook).
👉 Table of Contents 👈
- 👮 Requirements
- 💾 Installation
- 🍎 Apple docs
- 📝 Configuration
- 🚀 Usage
👮 Requirements
Only things needed are Laravel 7+ and to have the PHP Zip extension installed and enabled.
💾 Installation
The best and easiest way to install the package is using the Composer package manager. To do so, run this command in your project root:
Then, add the Thenextweb\PassGeneratorServiceProvider
provider to the providers array in config/app.php
:
That's it!
🍎 Apple docs
From now on, some stuff is much better explained on the Apple docs, so when in doubt just check (if you haven't done so) the following documents:
📝 Configuration
To start using the package some Apple files are needed, as well as some action in order to convert them to more friendly formats:
-
Go to the Apple Developer page ➵ Identifiers ➵ Pass Type IDs.
-
Next, you need to create a pass type ID. This is similar to the bundle ID for apps. It will uniquely identify a specific kind of pass. It should be of the form of a reverse-domain name style string (i.e., pass.com.example.appname).
-
After creating the pass type ID, click on
Edit
and follow the instructions to create a new Certificate. -
Once the process is finished, the pass certificate can be downloaded. That's not it though, the certificate is downloaded as
.cer
file, which need to be converted to.p12
in order to work. If you are using a Mac you can import it into Keychain Access and export it from there. Make sure to remember the password you have given to the exported file since you'll have to use it later. You can also use other tools to convert the certificate but be sure it includes the private key on the exported PKCS12 file. - If you have made iOS development, you probably have already the Apple Worldwide Developer Relations Intermediate Certificate in your Mac’s keychain. If not, it can be downloaded from the Apple Website (on
.cer
format). This one needs to be exported as.pem
, you can also do so from Keychain Access (or whatever tool you use to manage certificates on your OS).
Once all this tedious process has been done, everything is almost ready to start using the package. The easiest now is to add to the following keys to your .env
file:
- CERTIFICATE_PATH ➪ The path to the
.p12
pass certificate. - CERTIFICATE_PASS ➪ The password set to unlock the certificate when it was exported.
- WWDR_CERTIFICATE ➪ The path to the Apple Worldwide Developer Relations Intermediate Certificate on
.pem
format.
In case there is a reason the config file must be modified (conflicting env keys, dynamic certificates required...), it can be published with the following command:
🚀 Usage
To create a pass for the first time, you have to first create the pass definition, either as a JSON file or as an array. It is really recommended to have already read the Apple docs as well as the PassKit Package Format Reference.
Now, a valid ticket is already in place. Apple recommends a MIME type to serve it to its devices so something like the following should do:
Later on, if your users need to download the pass again, you don't need to create it again (wasting all those CPU cycles on crypto stuff), you can just do something like:
It is also possible to retrieve the actual path to a pass on your filesystem. By default, Passgenerator will copy your default filesystem config (usually rooted on storage_path('app')
but you can always do getPassFilePath($pass_identifier)
and retrieve the real path (in case it exists).
Definitions
It is also possible to programatically create/modify a pass using the definitions objects. Eg.-
All versions of passgenerator with dependencies
illuminate/support Version ^7.0|^8.0|^9.0|^10.0|^11.0
illuminate/filesystem Version ^7.0|^8.0|^9.0|^10.0|^11.0
thecodingmachine/safe Version ^2.1