PHPackages                             ashraam/license-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. ashraam/license-generator

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

ashraam/license-generator
=========================

This package allows you to easily generate license keys with custom templates

v1.0.1(11mo ago)037MITPHPPHP ^7.4|^8.0

Since May 27Pushed 11mo agoCompare

[ Source](https://github.com/Ashraam/license-generator)[ Packagist](https://packagist.org/packages/ashraam/license-generator)[ Docs](https://github.com/ashraam/license-generator)[ RSS](/packages/ashraam-license-generator/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (2)Versions (4)Used By (0)

License number generator
========================

[](#license-number-generator)

[![Latest Version on Packagist](https://camo.githubusercontent.com/8f8bb2138421d437f34636dd2591aacc958244714ea48b0b2559da2e0cfec969/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6173687261616d2f6c6963656e73652d67656e657261746f722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/ashraam/license-generator)[![Total Downloads](https://camo.githubusercontent.com/71b9e065eb3c21a6e36c27e89e509a7260f6edfca8773fbac3710e8e44314523/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6173687261616d2f6c6963656e73652d67656e657261746f722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/ashraam/license-generator)

This package allows you to create random license numbers style code. You can customize the template and add a prefix or suffix.

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

[](#installation)

You can install the package via composer:

```
composer require ashraam/license-generator
```

Usage
-----

[](#usage)

```
$generator = new \Ashraam\LicenseGenerator\LicenseGenerator();

$generator
    ->prefix('MY-')
    ->template('XXXX-9999-X9X9')
    ->generateOne(); // MY-DESQ-4857-X6P8

$generator
    ->suffix('-END')
    ->template('XXXX-9999-X9X9')
    ->generateOne(); // FDIS-4572-D6D3-END

$generator
    ->lowerCase()
    ->template('XXXX-9999-X9X9')
    ->generateOne(); // qspr-5423-f5k9

$generator
    ->template('XXXX-9999')
    ->generateMany(3); // ['GDTS-4585', 'YTRH-5558', 'POGQ-4454']
```

You can use one of the three methods to generate codes:

- generateOne(): will return a string
- generateMany(X): will return an array
- generate(X): will return a string if X equals 1 or an array

### Testing

[](#testing)

```
composer test
```

### Changelog

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information what has changed recently.

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

### Security

[](#security)

If you discover any security related issues, please email  instead of using the issue tracker.

Credits
-------

[](#credits)

- [Romain BERTOLUCCI](https://github.com/ashraam)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

PHP Package Boilerplate
-----------------------

[](#php-package-boilerplate)

This package was generated using the [PHP Package Boilerplate](https://laravelpackageboilerplate.com) by [Beyond Code](http://beyondco.de/).

###  Health Score

29

—

LowBetter than 59% of packages

Maintenance50

Moderate activity, may be stable

Popularity7

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity44

Maturing project, gaining track record

 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

Every ~0 days

Total

2

Last Release

357d ago

### Community

Maintainers

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

---

Top Contributors

[![Ashraam](https://avatars.githubusercontent.com/u/4686383?v=4)](https://github.com/Ashraam "Ashraam (9 commits)")

---

Tags

ashraamlicense-generator

###  Code Quality

TestsPest

### Embed Badge

![Health badge](/badges/ashraam-license-generator/health.svg)

```
[![Health](https://phpackages.com/badges/ashraam-license-generator/health.svg)](https://phpackages.com/packages/ashraam-license-generator)
```

###  Alternatives

[dotty/dotty

Easy access to array data using dot notation

1293.8k1](/packages/dotty-dotty)

PHPackages © 2026

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