PHPackages                             3neti/laravel-vouchers - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. 3neti/laravel-vouchers

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

3neti/laravel-vouchers
======================

Voucher system for Laravel 10+

v1.3.0(1w ago)0322↓59.4%1MITPHPPHP ^8.2

Since Apr 4Pushed 1w agoCompare

[ Source](https://github.com/3neti/laravel-vouchers)[ Packagist](https://packagist.org/packages/3neti/laravel-vouchers)[ RSS](/packages/3neti-laravel-vouchers/feed)WikiDiscussions master Synced 1w ago

READMEChangelog (2)Dependencies (27)Versions (5)Used By (1)

Laravel Vouchers (3neti Fork)
=============================

[](#laravel-vouchers-3neti-fork)

[![License](https://camo.githubusercontent.com/2c5b95b34a9c14598966429711af9b17b05a61368d7f1594a0eabfaa2e71dd6c/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f336e6574692f6c61726176656c2d766f7563686572732e7376673f7374796c653d666c61742d737175617265)](LICENSE)

⚠️ Fork Notice
--------------

[](#️-fork-notice)

This package is a **maintained fork** of the original
`frittenkeez/laravel-vouchers`.

### Why this fork exists

[](#why-this-fork-exists)

- ✅ Adds **Laravel 13 compatibility**
- ✅ Aligns with **3neti migration ownership architecture**
- 🔄 Will evolve independently to support:
    - settlement integration
    - idempotency
    - metadata improvements

> This package is now the **source of truth for the vouchers table schema** in the 3neti ecosystem.

---

📦 Installation
--------------

[](#-installation)

```
composer require 3neti/laravel-vouchers:^1.2
```

---

🚨 Migration Policy (Important)
------------------------------

[](#-migration-policy-important)

Unlike the original package:

### ❌ Original behavior

[](#-original-behavior)

- Requires `vendor:publish` for migrations

### ✅ This fork

[](#-this-fork)

- Uses `loadMigrationsFrom()`
- **No publishing required**
- Migrations are loaded automatically

```
php artisan migrate
```

### Native JSON metadata

[](#native-json-metadata)

The `vouchers.metadata` and `redeemers.metadata` columns use Laravel's `jsonb()` schema declaration. Fresh databases therefore use PostgreSQL `jsonb`, MySQL `json`, and SQLite's JSON-compatible text storage.

Metadata is limited to 8 MiB by default. It is intended for structured instructions, settlement facts, and evidence descriptors. Store images, signatures, PDFs, and other binary artifacts in private object storage and keep only their storage references, hashes, MIME types, and dimensions in voucher metadata.

```
'metadata' => [
    'max_bytes' => 8 * 1024 * 1024,
],
```

The limit may be overridden in `config/vouchers.php` when an application has a reviewed operational reason.

### 🧠 Ownership Rule

[](#-ownership-rule)

This package **owns**:

- `vouchers` table
- `voucherables` table
- all schema updates related to vouchers

Other packages (e.g., `3neti/voucher`, `3neti/cash`)
**must NOT modify voucher tables directly**

---

🔄 Versioning Strategy
---------------------

[](#-versioning-strategy)

Current: `v1.2.0`

Upcoming releases will follow:

- `v1.x` → compatibility + internal alignment
- `v2.x` → schema ownership + architectural changes

---

⚙️ Configuration
----------------

[](#️-configuration)

```
php artisan vendor:publish --tag=config --provider="FrittenKeeZ\\Vouchers\\VouchersServiceProvider"
```

---

🚀 Usage
-------

[](#-usage)

This package provides the `Vouchers` facade:

```
use FrittenKeeZ\\Vouchers\\Facades\\Vouchers;
```

---

### Generate Codes

[](#generate-codes)

```
$code = Vouchers::generate('***-***-***', '1234567890');

$codes = Vouchers::batch(10);
```

---

### Create Vouchers

[](#create-vouchers)

```
$voucher = Vouchers::create();
$vouchers = Vouchers::create(10);
```

---

### Redeem Vouchers

[](#redeem-vouchers)

```
Vouchers::redeem('123-456-789', $user);
```

Handles exceptions:

- VoucherNotFoundException
- VoucherRedeemedException
- VoucherExpiredException
- VoucherUnstartedException

---

### Unredeem Vouchers

[](#unredeem-vouchers)

```
Vouchers::unredeem('123-456-789', $user);
```

---

🧩 Traits
--------

[](#-traits)

### HasVouchers

[](#hasvouchers)

```
use FrittenKeeZ\\Vouchers\\Concerns\\HasVouchers;

$user->vouchers;
$user->createVoucher();
```

---

### HasRedeemers

[](#hasredeemers)

```
use FrittenKeeZ\\Vouchers\\Concerns\\HasRedeemers;

$user->redeemers;
```

---

🧠 Architectural Notes (3neti)
-----------------------------

[](#-architectural-notes-3neti)

This fork is part of a larger system:

- `voucher` → business logic
- `cash` → financial ledger
- `settlement-envelope` → settlement gating
- `wallet` → balance orchestration

### Role of this package

[](#role-of-this-package)

> **Schema + Core Voucher Engine**

It should remain:

- deterministic
- storage-focused
- side-effect minimal

---

🚫 Anti-Patterns
---------------

[](#-anti-patterns)

Do NOT:

- modify voucher tables outside this package
- duplicate voucher schema in other packages
- treat vouchers as business logic containers

---

🧪 Testing
---------

[](#-testing)

```
composer test
```

The release matrix covers PHP 8.3 and 8.4 on Laravel 12 and 13. Native metadata contracts are additionally exercised against PostgreSQL 16 and MySQL 8.4. The declared constraints retain compatibility with Laravel 10 and 11 for existing consumers.

---

🙏 Acknowledgement
-----------------

[](#-acknowledgement)

Original package by: **Frederik Sauer**

---

📄 License
---------

[](#-license)

MIT

###  Health Score

47

—

FairBetter than 93% of packages

Maintenance98

Actively maintained with recent releases

Popularity17

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity50

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 86.7% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~41 days

Total

4

Last Release

13d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/586e1ed70140038e6348728222adbcf68bfc4455b1f94a4f8bcbe57917a63d57?d=identicon)[3neti](/maintainers/3neti)

---

Top Contributors

[![FrittenKeeZ](https://avatars.githubusercontent.com/u/1186125?v=4)](https://github.com/FrittenKeeZ "FrittenKeeZ (137 commits)")[![3neti](https://avatars.githubusercontent.com/u/89447696?v=4)](https://github.com/3neti "3neti (7 commits)")[![laravel-shift](https://avatars.githubusercontent.com/u/15991828?v=4)](https://github.com/laravel-shift "laravel-shift (6 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (5 commits)")[![patr612e](https://avatars.githubusercontent.com/u/44566563?v=4)](https://github.com/patr612e "patr612e (3 commits)")

---

Tags

laravelvouchercoupondiscount

###  Code Quality

TestsPest

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/3neti-laravel-vouchers/health.svg)

```
[![Health](https://phpackages.com/badges/3neti-laravel-vouchers/health.svg)](https://phpackages.com/packages/3neti-laravel-vouchers)
```

###  Alternatives

[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

265.2k](/packages/aedart-athenaeum)[psalm/plugin-laravel

Psalm plugin for Laravel

3345.4M354](/packages/psalm-plugin-laravel)[illuminate/queue

The Illuminate Queue package.

20433.0M1.8k](/packages/illuminate-queue)[mike-bronner/laravel-model-caching

Automatic caching for Eloquent models.

2.4k161.4k2](/packages/mike-bronner-laravel-model-caching)[laravel/ai

The official AI SDK for Laravel.

1.1k4.6M327](/packages/laravel-ai)[frittenkeez/laravel-vouchers

Voucher system for Laravel 12+

5722.3k2](/packages/frittenkeez-laravel-vouchers)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
