Lemon Squeezy Setup
There are some differences between the Lemon Squeezy setup and the Paddle setup. This guide explains how to configure Lemon Squeezy in Laratic.
1. Create Lemon Squeezy Account
Sign up for a Lemon Squeezy account and complete all onboarding steps in the Lemon Squeezy dashboard before continuing.
2. Get Your Store ID and API Key
To configure Lemon Squeezy integration, you need:
- Store ID - Found in your Lemon Squeezy dashboard under Settings > Stores
- API Key - Create an API key in Settings > API
- Signing Secret - Skip this for now.
These values should be stored in your .env file; see the example in the code snippet below.
LEMON_SQUEEZY_STORE=your_store_id
LEMON_SQUEEZY_API_KEY=your_api_key_here
LEMON_SQUEEZY_SIGNING_SECRET=skip_for_now
After changing these values, clear and cache your configuration:
php artisan config:clear
php artisan config:cache
3. Configure Webhooks
Webhooks are used to receive events from Lemon Squeezy and keep your local database in sync. See the Webhooks page for more information.
4. Add Products and Plans
After setting up your Lemon Squeezy account, you can add your products and subscription plans. Please follow the guides on the Products pages.
References
| Category | Path / Name | Description |
|---|---|---|
| Model | App\Models\Order | Order model with Lemon Squeezy order relationship |
| Model | App\Models\Plan | Subscription plan model with Lemon Squeezy variant ID |
| Model | App\Models\Product | One-time product model with Lemon Squeezy variant ID |
| Controller | App\Http\Controllers\PlanController | Handles subscription plan viewing and checkout |
| Controller | App\Http\Controllers\ProductController | Handles one-time product viewing and checkout |
| Controller | App\Http\Controllers\OrderController | Handles user order viewing and status checks |
| Controller | App\Http\Controllers\SubscriptionController | Handles subscription status and pending pages |
| Controller | App\Http\Controllers\Admin\OrderController | Admin controller for viewing orders and transactions |
| Livewire | App\Livewire\Subscription\Manage | Subscription management component (swap, cancel, update payment) |
| Livewire | App\Livewire\Admin\PlansProducts | Admin component for managing plans and products with sync functionality |
| Listener | App\Listeners\LemonSqueezyEventListener | Handles Lemon Squeezy webhook events (order_created, subscription_payment_success) |
| Command | App\Console\Commands\SyncLemonSqueezyProducts | Artisan command to sync products and plans from Lemon Squeezy |
| Migration | create_orders_table | Migration for orders table with lemon_squeezy_id field |
| Migration | create_plans_table | Migration for plans table with lemon_squeezy_product_id and lemon_squeezy_variant_id fields |
| Migration | create_products_table | Migration for products table with lemon_squeezy_product_id and lemon_squeezy_variant_id fields |
| Migration | create_lemon_squeezy_subscriptions_table | Lemon Squeezy package migration for subscriptions |
| Migration | create_lemon_squeezy_customers_table | Lemon Squeezy package migration for customers |
| Routes | GET /plans/start (plans.start) | Route to view available subscription plans |
| Routes | GET /plans/{variant_id} (plans.show) | Route to initiate subscription checkout |
| Routes | GET /products (products.index) | Route to view available products |
| Routes | GET /products/{variant_id} (products.show) | Route to initiate product checkout |
| Routes | GET /orders (orders.index) | Route to view user orders |
| Routes | GET /subscription/pending (subscription.pending) | Route to view subscription pending page after checkout |
| Routes | GET /subscription/status (subscription.status) | Route to check subscription status (returns JSON) |
| Routes | GET /subscription (subscription.manage) | Route to manage subscription (requires subscribed middleware) |
| Routes | GET /admin/orders (admin.orders.index) | Admin route to view all orders |