Laravel Passport has a
passport:install command. However, this command cannot be run in Lambda because it needs to write files to the
Instead, here is what you need to do:
Run the following command on your machine to generate key files:
php artisan passport:keys
This will generate the
storage/oauth-public.key files, which need to be deployed.
Depending on how you deploy your application (from your machine, or from CI), you may want to whitelist them in
package: patterns: - ... # Exclude the 'storage' directory - '!storage/**' # Except the public and private keys required by Laravel Passport - 'storage/oauth-private.key' - 'storage/oauth-public.key'
You can now redeploy the application:
Finally, you can create the tokens (which is the second part of the
serverless bref:cli --args="passport:client --personal --name 'Laravel Personal Access Client'" serverless bref:cli --args="passport:client --password --name 'Laravel Personal Access Client'"
All these steps were replacements of running the
passport:install command from the Passport documentation (opens in a new tab).