PHPackages                             serenity\_technologies/cashier-gumroad - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Payment Processing](/categories/payments)
4. /
5. serenity\_technologies/cashier-gumroad

ActiveLibrary[Payment Processing](/categories/payments)

serenity\_technologies/cashier-gumroad
======================================

Laravel Cashier for Gumroad - Subscription billing and payment management

v1.1.19(3mo ago)130MITPHP ^8.1

Since Apr 4Compare

[ Source](https://github.com/Serenity-Technologies/cashier-gumroad)[ Packagist](https://packagist.org/packages/serenity_technologies/cashier-gumroad)[ RSS](/packages/serenity-technologies-cashier-gumroad/feed)WikiDiscussions Synced 3w ago

READMEChangelog (1)Dependencies (7)Versions (28)Used By (0)

Laravel Cashier for Gumroad - Complete Documentation
====================================================

[](#laravel-cashier-for-gumroad---complete-documentation)

Table of Contents
-----------------

[](#table-of-contents)

1. [Overview](#overview)
2. [Installation &amp; Setup](#installation--setup)
3. [Configuration](#configuration)
4. [Database Schema](#database-schema)
5. [Core Concepts](#core-concepts)
6. [Checkout Flows](#checkout-flows)
7. [Subscription Management](#subscription-management)
8. [Webhook Handling](#webhook-handling)
9. [License Management](#license-management)
10. [Offer Codes &amp; Discounts](#offer-codes--discounts)
11. [Sales Tracking](#sales-tracking)
12. [Revenue Analytics](#revenue-analytics)
13. [Console Commands](#console-commands)
14. [Events &amp; Listeners](#events--listeners)
15. [Security Best Practices](#security-best-practices)
16. [Common Patterns &amp; Examples](#common-patterns--examples)
17. [API Limitations](#api-limitations)
18. [Troubleshooting](#troubleshooting)

---

Overview
--------

[](#overview)

Laravel Cashier for Gumroad provides a fluent, expressive interface to Gumroad's subscription billing and payment services. It handles almost all of the boilerplate code needed for subscription management, including:

- **Checkout URLs &amp; Widgets** - Generate overlay/embed widgets and direct checkout URLs
- **Subscription Management** - Track and manage subscriptions locally
- **Webhook Handling** - Process all Gumroad webhook events securely
- **License Management** - Verify and manage license keys
- **Offer Codes** - Create and manage discount codes
- **Sales Tracking** - Record and analyze sales data
- **Revenue Analytics** - MRR, ARR, churn rate, LTV, and more

### Package Architecture

[](#package-architecture)

```
┌─────────────────────────────────────────────────────────────┐
│                      Your Laravel App                        │
│  ┌──────────────────┐    ┌──────────────────────────────┐   │
│  │  User Model      │    │  Event Listeners             │   │
│  │  (Billable)      │    │  (Welcome emails, etc)       │   │
│  └────────┬─────────┘    └──────────────────────────────┘   │
│           │                                                   │
│           ▼                                                   │
│  ┌──────────────────────────────────────────────────────┐    │
│  │           Cashier Services Layer                      │    │
│  │  ┌──────────────┐  ┌──────────┐  ┌──────────────┐   │    │
│  │  │ Checkout     │  │ License  │  │ Subscription │   │    │
│  │  │ Service      │  │ Service  │  │ Service      │   │    │
│  │  └──────────────┘  └──────────┘  └──────────────┘   │    │
│  │                                                       │    │
│  │  ┌──────────────┐  ┌──────────┐  ┌──────────────┐   │    │
│  │  │ Webhook      │  │ Offer    │  │ Revenue      │   │    │
│  │  │ Handler      │  │ Code     │  │ Analytics    │   │    │
│  │  └──────────────┘  └──────────┘  └──────────────┘   │    │
│  └──────────────────────────────────────────────────────┘    │
└─────────────────────────────────────────────────────────────┘
                           ▲
                           │ API Calls
                           ▼
                    ┌──────────────┐
                    │  Gumroad API │
                    └──────────────┘

```

---

Installation &amp; Setup
------------------------

[](#installation--setup)

### Prerequisites

[](#prerequisites)

- PHP 8.1 or higher
- Laravel 9.0 or higher
- Gumroad account with API access token
- Composer

### Step 1: Install Package

[](#step-1-install-package)

```
composer require serenity_technologies/cashier-gumroad
```

### Step 2: Add Billable Trait to User Model

[](#step-2-add-billable-trait-to-user-model)

The `Billable` trait provides subscription management methods to your user model:

```
