---
title: "Coupons for Laravel — docs | Roundly"
description: "Developer docs for Coupons for Laravel: fixed, percentage and free-shipping coupons, currency locks, usage caps, atomic redemption, events and testing."
url: https://roundly-consulting.com/open-source/docs/coupons-for-laravel
language: en
---

[All packages](https://roundly-consulting.com/open-source.md)

Open source

# Coupons for Laravel

Install

`composer require roundly-consulting/coupons-for-laravel`

Requires: PHP ^8.4 · Laravel ^12.0|^13.0

[GitHub](https://github.com/roundly-consulting/coupons-for-laravel) [Packagist](https://packagist.org/packages/roundly-consulting/coupons-for-laravel) [Donate (opens in a new tab)](https://donate.stripe.com/dRmeVe8FX5PF1Qd9pXcEw00) [Patreon](https://www.patreon.com/cw/roundly)

## Overview

A complete coupon system for Laravel. Create fixed-amount, percentage and free-shipping coupons with currency locks, minimum spend, activation windows and global or per-customer usage limits, then redeem them with every rule checked and usage counted inside one locked database transaction — a cap of 100 means exactly 100, even under a rush. Every amount is an exact money-for-laravel Money, correct for zero- and three-decimal currencies. MIT-licensed and dependency-light: Laravel, ext-bcmath and two Roundly foundation packages — no third-party runtime dependencies.

### What you get

#### Three discount types

Fixed amounts in minor units, percentages in basis points with an optional cap, and free shipping as a flag your checkout applies to its own shipping line.

#### Rules you control

Currency lock, minimum spend, activation and expiry windows, a global usage cap and a per-customer cap — with guest checkout supported.

#### Atomic redemption

Every check and the usage increment run in one transaction against a row read with lockForUpdate, so a cap of 100 means exactly 100.

#### One eligibility guard

Coupons::check(), redeem(), isRedeemableBy() and the Redeemable rule share one guard — a fixed check order, precise exceptions and translatable messages.

#### Exact money

Every amount is a money-for-laravel Money — exact for zero- and three-decimal currencies, never below zero, and composable in a DiscountStack.

#### Events, commands & fake

Five events, an expire kill-switch and a prune command, and Coupons::fake() — a recorder with assertions for every create, redeem, revoke and prune.

#### Facade, DI or actions

Call the Coupons facade, inject CouponManager for the same API, or run single-purpose action classes in your own jobs — one code path behind all three.

### Documentation

#### [Installation](https://roundly-consulting.com/open-source/docs/coupons-for-laravel/installation.md)

Install via Composer, publish and run the two migrations, and optionally publish the config and the translation strings.

#### [Configuration](https://roundly-consulting.com/open-source/docs/coupons-for-laravel/configuration.md)

Every config key, its default and env variable — coupon model, redeemer key type, default currency, tracking, code format and route key.

#### [Money, units & currency lock](https://roundly-consulting.com/open-source/docs/coupons-for-laravel/money-and-units.md)

How a coupon’s value is stored — minor units or basis points — and when a coupon must be locked to a single currency.

#### [The Coupons facade](https://roundly-consulting.com/open-source/docs/coupons-for-laravel/coupons-facade.md)

One entry point for everything — create, look up, check, preview, redeem, revoke, expire and prune coupons, flat or through a Coupons::code() handle.

#### [DI and actions](https://roundly-consulting.com/open-source/docs/coupons-for-laravel/without-facade.md)

Inject CouponManager instead of calling the facade, or run the single-purpose actions yourself — plus the full facade method to action map.

#### [Creating coupons](https://roundly-consulting.com/open-source/docs/coupons-for-laravel/creating-coupons.md)

Create fixed, percentage and free-shipping coupons with CreateCouponData — named constructors, caps, minimum spend and validation rules.

#### [Generated codes](https://roundly-consulting.com/open-source/docs/coupons-for-laravel/generated-codes.md)

Control the length and alphabet of auto-generated codes — drawn from a CSPRNG, case-insensitive like every code, validated on every use.

#### [Redeeming coupons](https://roundly-consulting.com/open-source/docs/coupons-for-laravel/redeeming.md)

Validate and redeem in one atomic step — the locked transaction, the fixed check order, RedemptionResult and an exception for every failure.

#### [The Coupon model](https://roundly-consulting.com/open-source/docs/coupons-for-laravel/coupon-model.md)

Lifecycle mutators, state checks, casts and discount math on the Coupon model — activate, expire, cap, apply and discountFor.

#### [Display helpers](https://roundly-consulting.com/open-source/docs/coupons-for-laravel/display-helpers.md)

Non-throwing helpers for views and APIs — remaining uses, usage percentage, can-this-customer-redeem and a safe discount preview.

#### [Redeemers & per-customer limits](https://roundly-consulting.com/open-source/docs/coupons-for-laravel/redeemers.md)

Add HasCoupons to your User model, cap uses per customer, read redemption history and support UUID or ULID redeemer keys.

#### [Validation rule](https://roundly-consulting.com/open-source/docs/coupons-for-laravel/validation.md)

Validate a promo-code field with the Redeemable rule — the same checks as redemption and a translatable message for the first failing reason.

#### [Discount types & composing](https://roundly-consulting.com/open-source/docs/coupons-for-laravel/discount-types.md)

The DiscountType enum — labels for admin UIs, conversion to a money Discount, and combining coupons with other discounts in a DiscountStack.

#### [Query scopes & route binding](https://roundly-consulting.com/open-source/docs/coupons-for-laravel/query-scopes.md)

Find active, expired, exhausted and redeemable coupons with query scopes, and bind {coupon} route parameters by code or by id.

#### [Events](https://roundly-consulting.com/open-source/docs/coupons-for-laravel/events.md)

Five events for analytics, fraud checks and sold-out notices — a coupon created, redeemed, rejected, exhausted or revoked.

#### [Artisan commands](https://roundly-consulting.com/open-source/docs/coupons-for-laravel/commands.md)

An admin kill-switch that expires coupons immediately, and a prune command that archives or deletes long-expired coupons.

#### [Exceptions](https://roundly-consulting.com/open-source/docs/coupons-for-laravel/exceptions.md)

One hierarchy under CouponException — catch the whole package, every “cannot redeem” reason, or each cause individually.

#### [Testing](https://roundly-consulting.com/open-source/docs/coupons-for-laravel/testing.md)

Coupons::fake() records creations, redemptions, refusals, revocations and prunes without writing a row — plus factory states for database tests.

#### [Extending](https://roundly-consulting.com/open-source/docs/coupons-for-laravel/extending.md)

Swap in your own Coupon subclass via coupons.model and reuse the eligibility guard in custom checkout flows.

#### [Database schema](https://roundly-consulting.com/open-source/docs/coupons-for-laravel/database-schema.md)

The coupons and coupon\_redemptions tables column by column — types, defaults, the shared currency column and soft deletes.

#### [Requirements](https://roundly-consulting.com/open-source/docs/coupons-for-laravel/requirements.md)

PHP 8.4+ with ext-bcmath, Laravel 12 or 13, MySQL/MariaDB, PostgreSQL or SQLite, and two Roundly packages Composer installs for you.

## Show your open-source love

This package is free and MIT-licensed. If it saves you time, a one-off donation or a Patreon membership keeps it maintained, tested and documented.

[More ways to support, including crypto](https://roundly-consulting.com/support-us.md)

By donating, you agree to our [donation terms](https://roundly-consulting.com/donation-terms.md).

[Support our open source work (opens in a new tab)](https://donate.stripe.com/dRmeVe8FX5PF1Qd9pXcEw00) [Join us on Patreon (opens in a new tab)](https://www.patreon.com/cw/roundly)

## Want this built into your product?

We integrate our packages into custom Laravel and AI builds. Tell us what you're working on and we'll reply within 48 hours.

[Get a quote in 48 hours](https://roundly-consulting.com/contact.md) [Browse all packages](https://roundly-consulting.com/open-source.md)
