Lemon Squeezy Webhooks

Laratic is already configured to handle Lemon Squeezy webhooks. You just need to set up the webhook in your Lemon Squeezy dashboard.

Configure Webhook in Lemon Squeezy Dashboard (For Production)

  1. Navigate to Settings > Webhooks in your Lemon Squeezy dashboard.
  2. Click Create Webhook.
  3. Enter your webhook URL:
    • Production: https://your-domain.com/lemon-squeezy/webhook
    • Local testing: Use ngrok (see below) to expose your local server
  4. Select the events you want to receive, you can choose all of them.
  5. Save the webhook configuration.

Testing Locally with ngrok

Note: You need an ngrok account to use ngrok. Sign up for a free account at ngrok.com if you don't have one.

  1. Start your Laravel application locally, make sure it's running on port 8000:
    php artisan serve
  2. In a separate terminal, start ngrok to expose your local server (use the URL from the php artisan serve command):
    php artisan lmsqueezy:listen ngrok
    If your app is running on a different port, you can specify the port with the --port option:
    php artisan lmsqueezy:listen ngrok --port=8001
  3. This should automatically add the webhook URL to the Lemon Squeezy webhook configuration in the Lemon Squeezy dashboard. Go there and get the webhook secret and add it to your .env file.
    LEMON_SQUEEZY_SIGNING_SECRET=add the webhook secret here

The webhook endpoint is already configured in bootstrap/app.php and excluded from CSRF protection. The LemonSqueezyEventListener automatically handles webhook events.

To learn more about the webhook events, see the Lemon Squeezy Laravel package documentation.