PHPackages                             gan068/simple-coupon-generator - 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. gan068/simple-coupon-generator

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

gan068/simple-coupon-generator
==============================

Simple PHP coupon code generator to genrate N number of coupons.

1.0(8y ago)09.2k↓11.1%MITPHP

Since Apr 12Pushed 8y ago1 watchersCompare

[ Source](https://github.com/gan068/simple-coupon-generator)[ Packagist](https://packagist.org/packages/gan068/simple-coupon-generator)[ RSS](/packages/gan068-simple-coupon-generator/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (2)Used By (0)

Simple Coupon Generator
=======================

[](#simple-coupon-generator)

Coupon generator this is php class, which provides the ability to generate coupon codes on various parameters. Its key feature is the generation of a coupon code on a mask like this “XXXXXX” or “prefix-XXXX-XXXX-suffix” where ‘X’ – random symbol, ‘-’ – custom separator.

### Key Feature

[](#key-feature)

- Support prefix- and –suffix
- Support any coupon mask
    - Support all numbers, alphabets, symbols
    - Support different lenghts
    - Generate N number of coupons
    - Simple Portal

Usage
-----

[](#usage)

### SubStacks General Usage

[](#substacks-general-usage)

```
$coupon_code_options = array(
	    'prefix' => '',
	    'suffix' => '',
	    'length' => 10,
	    'letters' => false,
	    'numbers' => true
);
```

```
use gan068\SimpleCouponGenerator\Coupon; //use namespace
```

```
$coupon_code = Coupon::generateCoupons($coupon_code_options);
```

1. Dynamic length

```
	Coupon::generate(8);  	// J5BST6NQ
```

2. Using prefix

```
	Coupon::generate(6, ”XYZ-”);    // XYZ-NT163E
```

3. Using suffix

```
	Coupon::generate(6, ”XYZ-”, “-ABC”);    // XYZ-TC2MSD-ABC
```

4. Without numbers

```
	Coupon::generate(6, ””, ””, false);    // LNTDRS
```

5. Without letters

```
	Coupon::generate(6, ””, ””, true, false);    // 835710
```

6. With symbols

```
	Coupon::generate(6, ””, ””, true, true, true);    // #H5&S!7
```

7. Random register (includes lower and uppercase)

```
	Coupon::generate(6, ””, ””, true, true, false, true);    // aT4hB2
```

8. With custom Mask (Note: length does not matter)

```
	Coupon::generate(1, ””, ””, true, true, false, false, “XXXXXX”);    // STG6N8
```

###  Health Score

32

—

LowBetter than 72% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity24

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity63

Established project with proven stability

 Bus Factor1

Top contributor holds 100% 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

Unknown

Total

1

Last Release

2958d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/70d705e0f1d2a1c8df7abd5268fb511669f2ebb0cb8dc8d1e8227a9d89259db5?d=identicon)[gan068](/maintainers/gan068)

---

Top Contributors

[![gan068](https://avatars.githubusercontent.com/u/91359?v=4)](https://github.com/gan068 "gan068 (2 commits)")

### Embed Badge

![Health badge](/badges/gan068-simple-coupon-generator/health.svg)

```
[![Health](https://phpackages.com/badges/gan068-simple-coupon-generator/health.svg)](https://phpackages.com/packages/gan068-simple-coupon-generator)
```

PHPackages © 2026

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