New

Just launched: Vueblocks, a brand-new search engine for Vue packages! Explore Vueblocks →

moirei/laravel-vouchers

Manage ecommerce vouchers
2,306 8
Install
composer require moirei/laravel-vouchers
Latest Version:3.0.1
PHP:^8.1
Laravel:8 · 9
Older releases:5 · 6 · 7
License:MIT
Last Updated:Mar 21, 2026
Links: GitHub  ·  Packagist
Maintainer: moirei

Laravel Vouchers

An ecommerce voucher generator. It associates vouchers with one or more eloquent model and allows multiple models to own/redeem vouchers.

:heavy_check_mark: Requirements

  • Laravel ^8
  • PHP ^8.1

Documentation

All documentation is available at the documentation site.

:green_heart: Unique Features

  • Associate one voucher with one or more items
  • Flexible redeemer models: vouchers can be redeemed by any model. User, Admin, Guest models.
  • Flexible voucher models: voucher can be associated with any model. Product, Variant, Ticket, whatever else.
  • Use vouchers once or multiple times
  • Limit access: can define model instances that are allowed or excluded from redeeming a Voucher
  • Multiple limit scheme; exhaust redeems per instance, per user or per product

Example usage:

$product = Product::find(1);
$voucher = $product->createVoucher();

$user->redeem($voucher);

Installation

You can install the package via composer:

composer require moirei/laravel-vouchers

Next publish the migration with

php artisan vendor:publish --tag="vouchers-migrations"

Then run the migrations:

php artisan migrate

You can publish the config file with:

php artisan vendor:publish --tag="vouchers-config"

Notes

  • The allow_models and deny_models attributes mentioned above are actually saved as can_redeem and cannot_redeem internally. They are mutated on boot creating or updating.
  • If you manage your resources with Nova, Nova Multiselect can be used directly with the can_redeem and cannot_redeem attributes. Example code here.

Credits

License

The MIT License (MIT). Please see License File for more information.

Related Packages

osoobe/laravel-promocodes

Laravel 10+ compatible promotion codes generator and validator.

5,006 0
beyondcode/laravel-vouchers

Allow users to redeem vouchers that are bound to models..

83,903 706
xdrop/laravel-promocodes

:package_description

3,272 0
morph-sa/laramorph-coupon

:package_description

1,295 5
zircotech/laravel-vouchers

Allow users to redeem vouchers that are bound to models..

1,253 0

Version History

Version Released PHP Laravel License
3.0.1 ^8.1 ^8|^9 MIT
3.0.0 ^8.1 ^8|^9 MIT
2.1.0 ^7.2|^8.1 ^7|^8|^9 MIT
2.0.0 ^7.2|^8.0 ^5.6|^6.0|^7.0|^8.0 MIT
1.1.3 ^7.2|^8.0 ^5.6|^6.0|^7.0|^8.0 MIT