PHPackages                             escolalms/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. escolalms/vouchers

ActivePackage

escolalms/vouchers
==================

Escola LMS Vouchers

0.1.22(9mo ago)08.9k↓40%1MITPHPPHP &gt;=7.4CI passing

Since Feb 9Pushed 8mo ago3 watchersCompare

[ Source](https://github.com/EscolaLMS/Vouchers)[ Packagist](https://packagist.org/packages/escolalms/vouchers)[ RSS](/packages/escolalms-vouchers/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (10)Dependencies (8)Versions (34)Used By (1)

Vouchers
========

[](#vouchers)

[![swagger](https://camo.githubusercontent.com/bf46f50926ef796b1bb0b6e41af746af52ff3aacdffb0533450f3b614a7334a2/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f646f63756d656e746174696f6e2d737761676765722d677265656e)](https://escolalms.github.io/Vouchers/)[![codecov](https://camo.githubusercontent.com/b05cc4c75eeb97ebb51fd774c4a878ebade0a3dd20bf2d55012056223af9aeaa/68747470733a2f2f636f6465636f762e696f2f67682f4573636f6c614c4d532f566f7563686572732f6272616e63682f6d61696e2f67726170682f62616467652e7376673f746f6b656e3d4e52414e34523841475a)](https://codecov.io/gh/EscolaLMS/Vouchers)[![phpunit](https://github.com/EscolaLMS/Vouchers/actions/workflows/test.yml/badge.svg)](https://github.com/EscolaLMS/Vouchers/actions/workflows/test.yml)[![downloads](https://camo.githubusercontent.com/8d4db0daf75afc6bad4ea322e7f86d5d4a2fc529bb0b751d6e5ccc7b0cb36cfb/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6573636f6c616c6d732f766f756368657273)](https://packagist.org/packages/escolalms/vouchers)[![downloads](https://camo.githubusercontent.com/56de72952c45ea68af2df222eb763c3ac592cf4a6907d3e89528feab308832b1/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6573636f6c616c6d732f766f756368657273)](https://packagist.org/packages/escolalms/vouchers)[![downloads](https://camo.githubusercontent.com/5deada4e4a0d8c1c9a4bc8b5183878b40c0f925f8b84a2a853f0f887565648c9/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f6573636f6c616c6d732f766f756368657273)](https://packagist.org/packages/escolalms/vouchers)[![Maintainability](https://camo.githubusercontent.com/6a546f3eacf51cf35c32f991357994450fb291452eb6cac907a42b62b8f6326a/68747470733a2f2f6170692e636f6465636c696d6174652e636f6d2f76312f6261646765732f62386338616131363937363936316636373062342f6d61696e7461696e6162696c697479)](https://codeclimate.com/github/EscolaLMS/Vouchers/maintainability)

Purpose
-------

[](#purpose)

This package lets you define Coupons that can be applied to User Cart before placing an Order, calculating a discount depending on multiple different, configurable rules.

Installation
------------

[](#installation)

- `composer require escolalms/vouchers`
- `php artisan migrate`
- `php artisan db:seed --class="EscolaLms\Vouchers\Database\Seeders\VoucherPermissionsSeeder"`

Dependencies
------------

[](#dependencies)

This package depends (and extends) on [EscolaLms/Cart](https://github.com/EscolaLMS/Cart) package and can not be used separately.

Usage
-----

[](#usage)

### Coupon rules

[](#coupon-rules)

Every coupon defines set of rules that are checked when User tries to add Coupon to Cart. Only if all conditions are met, coupon (discount) can be applied to given Cart content. Some of the conditions work differently depending on type of coupon.

- **Min/max amount** - cart value must be at least "min" amount, and if cart value is above "max" amount, discount is only calculated as if value was at the "max" level
- **Usage limits** - coupons can not be used after their global or per user limits are reached
- **Exclude promotions** - coupon can not be used if products with already discounted price are in the Cart

### Types of coupon

[](#types-of-coupon)

This package defines four type of discounts, that represent four separate strategies for calculating discount. There are two types that relate to whole Cart and two types that relate to specified Products.

#### **Fixed Cart amount coupon**

[](#fixed-cart-amount-coupon)

Coupon of type `EscolaLms\Vouchers\Enums::CART_FIXED` substracts constant amount from total price of Cart. See [`EscolaLms\Vouchers\Strategies\CartFixedDiscountStrategy`](src/Strategies/CartFixedDiscountStrategy.php).

- At least one of "included products" must be in Cart
- None of "excluded products" must be in Cart
- At least one of "included categories" must be in Cart
- None of "exclude categories" must be in Cart

#### **Percent Cart amount coupon**

[](#percent-cart-amount-coupon)

Coupon of type `EscolaLms\Vouchers\Enums::CART_PERCENT` substracts percentage based amount from total price of Cart, but only for Products not in "excluded products" or "excluded categories" list. See [`EscolaLms\Vouchers\Strategies\CartPercentDiscountStrategy`](src/Strategies/CartPercentDiscountStrategy.php).

- At least one of "included products" must be in Cart
- At least one of "included categories" must be in Cart

#### **Fixed Product coupon**

[](#fixed-product-coupon)

Coupon of type `EscolaLms\Vouchers\Enums::PRODUCT_FIXED` substracts constant amount from Product price, but only once per unique Product. Product must be specified in "included products". See [`EscolaLms\Vouchers\Strategies\ProductFixedDiscountStrategy`](src/Strategies/ProductFixedDiscountStrategy.php).

#### **Percent Product coupon**

[](#percent-product-coupon)

Coupon of type `EscolaLms\Vouchers\Enums::PRODUCT_FIXED` substracts percentage based amount from Product price. Product must be specified in "included products". See [`EscolaLms\Vouchers\Strategies\ProductPercentDiscountStrategy`](src/Strategies/ProductPercentDiscountStrategy.php).

### How to use Coupon

[](#how-to-use-coupon)

Coupon can be added to Cart using `POST /api/cart/voucher/` endpoint.

Endpoints
---------

[](#endpoints)

All the endpoints are defined in [![swagger](https://camo.githubusercontent.com/bf46f50926ef796b1bb0b6e41af746af52ff3aacdffb0533450f3b614a7334a2/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f646f63756d656e746174696f6e2d737761676765722d677265656e)](https://escolalms.github.io/vouchers/).

Tests
-----

[](#tests)

Run `./vendor/bin/phpunit` to run tests. See [tests](tests) directory.

Test details [![codecov](https://camo.githubusercontent.com/b05cc4c75eeb97ebb51fd774c4a878ebade0a3dd20bf2d55012056223af9aeaa/68747470733a2f2f636f6465636f762e696f2f67682f4573636f6c614c4d532f566f7563686572732f6272616e63682f6d61696e2f67726170682f62616467652e7376673f746f6b656e3d4e52414e34523841475a)](https://codecov.io/gh/EscolaLMS/vouchers) [![phpunit](https://github.com/EscolaLMS/Vouchers/actions/workflows/test.yml/badge.svg)](https://github.com/EscolaLMS/vouchers/actions/workflows/test.yml)

Events
------

[](#events)

There are no events emitted by this package.

Listeners
---------

[](#listeners)

There are no listeners specified in this package.

How to use this on frontend
---------------------------

[](#how-to-use-this-on-frontend)

### Admin panel

[](#admin-panel)

#### **Menu**

[](#menu)

[![Menu](docs/menu.png "Menu")](docs/menu.png)

#### **List of Coupons**

[](#list-of-coupons)

[![List of Coupons](docs/list.png "List of Coupons")](docs/list.png)

#### **Creating/editing Coupon**

[](#creatingediting-coupon)

[![Creating/editing Coupon](docs/edit.png "Creating/editing Coupon")](docs/edit.png)

Permissions
-----------

[](#permissions)

Permissions are defined in [Enum](src/Enums/VoucherPermissionsEnum.php) and seeded in [Seeder](database/seeders/VoucherPermissionsSeeder.php).

Roadmap. Todo. Troubleshooting
------------------------------

[](#roadmap-todo-troubleshooting)

- endpoint for removing Coupon from Cart

###  Health Score

40

—

FairBetter than 88% of packages

Maintenance59

Moderate activity, may be stable

Popularity24

Limited adoption so far

Community23

Small or concentrated contributor base

Maturity50

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 62.3% 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 ~42 days

Recently: every ~214 days

Total

31

Last Release

274d ago

PHP version history (2 changes)0.0.1PHP ^7.4|^8.0

0.1.21PHP &gt;=7.4

### Community

Maintainers

![](https://www.gravatar.com/avatar/c857f3115c790c573d0617d7e9ba4011269ef7b9dfdb003dc4388846a62b14f7?d=identicon)[qunabu](/maintainers/qunabu)

![](https://www.gravatar.com/avatar/e791b5bdad89e5839add900fa94fd709e7c0a3bb8c538513a5d287d682ed387a?d=identicon)[pa-cholek](/maintainers/pa-cholek)

---

Top Contributors

[![pa-cholek](https://avatars.githubusercontent.com/u/5345420?v=4)](https://github.com/pa-cholek "pa-cholek (38 commits)")[![daVitekPL](https://avatars.githubusercontent.com/u/58150098?v=4)](https://github.com/daVitekPL "daVitekPL (10 commits)")[![HerbertIV](https://avatars.githubusercontent.com/u/62691459?v=4)](https://github.com/HerbertIV "HerbertIV (4 commits)")[![mako321](https://avatars.githubusercontent.com/u/59456825?v=4)](https://github.com/mako321 "mako321 (3 commits)")[![dicani0](https://avatars.githubusercontent.com/u/58490533?v=4)](https://github.com/dicani0 "dicani0 (3 commits)")[![qunabu](https://avatars.githubusercontent.com/u/214608?v=4)](https://github.com/qunabu "qunabu (2 commits)")[![ArtKob](https://avatars.githubusercontent.com/u/108077902?v=4)](https://github.com/ArtKob "ArtKob (1 commits)")

---

Tags

e-commercelaravel

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/escolalms-vouchers/health.svg)

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

###  Alternatives

[escolalms/headless-h5p

Headless H5P Laravel REST API

2732.6k8](/packages/escolalms-headless-h5p)[escolalms/scorm

Escola LMS SCORM management

13124.9k7](/packages/escolalms-scorm)

PHPackages © 2026

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