PHPackages                             mariuszmalek/unique-number-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. mariuszmalek/unique-number-generator

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

mariuszmalek/unique-number-generator
====================================

Easy creation of unique number for your Eloquent models in Laravel

1.0.0(4y ago)16MITPHPPHP ^7.3|^8.0

Since Oct 15Pushed 3y ago1 watchersCompare

[ Source](https://github.com/mariuszmalek/unique-number-generator)[ Packagist](https://packagist.org/packages/mariuszmalek/unique-number-generator)[ Docs](https://github.com/mariuszmalek/unique-number-generator)[ RSS](/packages/mariuszmalek-unique-number-generator/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)Dependencies (8)Versions (5)Used By (0)

Unique-Number-Generator
=======================

[](#unique-number-generator)

Easy creation of unique number generator for your Eloquent models in Laravel.

> **NOTE:** These instructions are for the latest version of Laravel.
> If you are using an older version, please install a version of the package that [correlates to your Laravel version](#installation).

- [Installation](#installation)
- [Usage](#usage)
- [Bugs, Suggestions, Contributions and Support](#bugs-suggestions-contributions-and-support)
- [Copyright and License](#copyright-and-license)

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

[](#installation)

Depending on your version of Laravel, you should install a different version of the package.

1. Install the package via Composer:

    ```
    $ composer require mariuszmalek/unique-number-generator:dev-master
    ```

    The package will automatically register its service provider.
2. Optionally, publish the configuration file if you want to change any defaults:

    ```
    php artisan vendor:publish --provider="Malek\UniqueNumberGenerator\ServiceProvider"
    ```

Usage
-----

[](#usage)

Saving a model is easy:

```
$post->number = GeneratorNumber::generateID(Post::class, 'number', 'CLI-', $params);
```

*The first parameter is $model in which we search an existing class, the second is a specific column in the database.*

The next one is the prefix that will be added to the beginning of the result. The last one is the parameters for specific search classes. Only the first two parameters are required

Using traits:

```
use Malek\UniqueNumberGenerator\Numerable;

class Product extends Model
{
    use Numerable;

    /**
     * @return string
     */
    public function uniqueColumn(): string
    {
        return 'number';
    }
}
```

You can add a Trait, so that after creating the model, a new unique number will be automatically created. You also need to add the uniqueColumn function which will contain the name of the column to be used.

Bugs, Suggestions, Contributions and Support
--------------------------------------------

[](#bugs-suggestions-contributions-and-support)

Please use [Github](https://github.com/mariuszmalek/unique-number-generator) for reporting bugs, and making comments or suggestions.

See [CONTRIBUTING.md](CONTRIBUTING.md) for how to contribute changes.

Copyright and License
---------------------

[](#copyright-and-license)

[unique-number-generator](https://github.com/mariuszmalek/unique-number-generator)was written by [Mariusz Malek](https://mariuszmalek.com) and is released under the [MIT License](LICENSE.md).

Copyright (c) 2021 Mariusz Malek

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity58

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

Unknown

Total

1

Last Release

1668d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/38a97a0691c4700be74b37971afac666339c66a31be64c41b2dd66224aa72c6f?d=identicon)[mariuszmalek](/maintainers/mariuszmalek)

---

Top Contributors

[![mariuszmalek](https://avatars.githubusercontent.com/u/26696860?v=4)](https://github.com/mariuszmalek "mariuszmalek (17 commits)")

---

Tags

laravelgeneratorlumennumberuniqueunique-number-generator

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/mariuszmalek-unique-number-generator/health.svg)

```
[![Health](https://phpackages.com/badges/mariuszmalek-unique-number-generator/health.svg)](https://phpackages.com/packages/mariuszmalek-unique-number-generator)
```

###  Alternatives

[barryvdh/laravel-ide-helper

Laravel IDE Helper, generates correct PHPDocs for all Facade classes, to improve auto-completion.

14.9k123.0M686](/packages/barryvdh-laravel-ide-helper)[psalm/plugin-laravel

Psalm plugin for Laravel

3274.9M308](/packages/psalm-plugin-laravel)[aedart/athenaeum

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

255.2k](/packages/aedart-athenaeum)[scottybo/laravel-facebook-sdk

Fully unit tested Facebook SDK v5 integration for Laravel 7.x

2225.0k](/packages/scottybo-laravel-facebook-sdk)[bjuppa/laravel-blog

Add blog functionality to your Laravel project

483.3k2](/packages/bjuppa-laravel-blog)

PHPackages © 2026

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