Connect LemonSqueezy to Project
- Create a LemonSqueezy Account and set up your store
Setup API Keys
To connect LemonSqueezy to the Larafast project you need to set API keys.- Create an API token in your account from https://app.lemonsqueezy.com/settings/api
- Add
LEMON_SQUEEZY_API_KEY=
variable to .env file with API key - Add Store ID to .env
LEMON_SQUEEZY_STORE=
You can find your store ID in your Settings->Stores page

Migrations
To publish LemonSqueezy migration files, run the following commandSubscriptions
Create your products in LemonSqueezy -> https://app.lemonsqueezy.com/products and choose “Subscription” for the pricing option.
To find a Product ID and Variant ID, go to your products page-> https://app.lemonsqueezy.com/products

web.php
Single Payment Products
Create your products in LemonSqueezy -> https://app.lemonsqueezy.com/products and choose “Single Payment” for the pricing option.
To find a Variant ID, go to your products page-> https://app.lemonsqueezy.com/products

web.php
If you want to have a product checkout without logged in users, use LemonSqueezyService.php to retrieve products and product buy now links.
LemonSqueezy URL’s
Larafast comes with all URL’s pre-defined, you can find them in routes/web.phpweb.php
Middleware
Use pre-definedHttp/Middleware/Subscribed
middleware for subscription-protected routes.
web.php
Customer Portal
To redirect users to their Customer Portal for Subscription and Orders management use /billing routeweb.php
Webhooks
Finally, make sure to set up incoming webhooks. This is both needed in development and production. Webhooks In Development The easiest way to set this up while developing your app is with thephp artisan lmsqueezy:listen
command that ships with this package. This command will setup a webhook through the Lemon Squeezy API, start listening for any events and remove the webhook when quitting the command.
--cleanup
flag:
/lemon-squeezy/webhook
by default. Make sure to select all event types.
We also very much recommend to verify webhook signatures in production.
LEMON_SQUEEZY_SIGNING_SECRET=
in your .env file
To read more about Laravel and LemonSqueezy integration check the LemonSqueezy Laravel package doc-> https://github.com/lmsqueezy/laravel