PHPackages                             yearul/unique-id-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. yearul/unique-id-generator

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

yearul/unique-id-generator
==========================

yearul/unique-id-generator is a Laravel package that simplifies the generation of unique IDs with customizable formats, lengths, and rules, enhancing the efficiency of generating unique identifiers in Laravel applications.

v1.0(3y ago)16MITPHPPHP &gt;=7.4|^8.0

Since May 10Pushed 3y ago1 watchersCompare

[ Source](https://github.com/islamyearul/unique-id-generator)[ Packagist](https://packagist.org/packages/yearul/unique-id-generator)[ Docs](https://github.com/islamyearul/unique-id-generator)[ RSS](/packages/yearul-unique-id-generator/feed)WikiDiscussions main Synced 1mo ago

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

This is my package lara-unique-id
=================================

[](#this-is-my-package-lara-unique-id)

[![Latest Version on Packagist](https://camo.githubusercontent.com/024d898f463c1bdc142b0d7140e91b0a060cda3ecd110ca08cce11c537240dc8/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f79656172756c2f6c6172612d756e697175652d69642e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/yearul/unique-id-generator)

[![Total Downloads](https://camo.githubusercontent.com/37b839457996d3dfd95b29d9012daa7f2ddb093ba71eab76228bfa0fd88ce4aa/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f79656172756c2f6c6172612d756e697175652d69642e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/yearul/unique-id-generator)

This is where your description should go. Limit it to a paragraph or two. Consider adding a small example.

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

[](#installation)

You can install the package via composer:

```
composer require yearul/lara-unique-id
```

You can publish and run the migrations with:

```
php artisan vendor:publish --tag="lara-unique-id-migrations"
php artisan migrate
```

You can publish the config file with:

```
php artisan vendor:publish --tag="lara-unique-id-config"
```

This is the contents of the published config file:

```
return [
    /*
    |--------------------------------------------------------------------------
    | Unique Id Generator Config
    |--------------------------------------------------------------------------
    |
    | This is the config file for unique id generator. You can override
    | this config file by placing it in your application's config directory
    | and change the values as per your need.
    |
    */

     /*
    |--------------------------------------------------------------------------
    | Default Pad Length
    |--------------------------------------------------------------------------
    |
    | If no  pad length is provided to the generate method, this value will be used
    |
    */
    "pad_len" => 5,

    /*
    |--------------------------------------------------------------------------
    | Default Prefix
    |--------------------------------------------------------------------------
    |
    | If no prefix is provided to the generate method, this value will be used
    |
    */
    "prefix" => "YEA",
    /*
    |--------------------------------------------------------------------------
    | Default year and year_val
    |--------------------------------------------------------------------------
    |
    | If no year and year_val is provided to the generate method, this value will be used
    |
    */

    "year" => true,
    "year_val" => date('Y'),

    /*
    |--------------------------------------------------------------------------
    | Default  pad string
    |--------------------------------------------------------------------------
    |
    | If no pad string is provided to the generate method, this value will be used
    |
    */

    "pad_string" => '0',   // 0, #, *, $.......etc
    /*
    |--------------------------------------------------------------------------
    | Default  pad_direction
    |--------------------------------------------------------------------------
    |
    | If no pad_direction is provided to the generate method, this value will be used
    |
    */

    "pad_direction" => STR_PAD_LEFT,   // STR_PAD_LEFT, STR_PAD_RIGHT
];
```

Optionally, you can publish the views using

```
php artisan vendor:publish --tag="lara-unique-id-views"
```

Usage
-----

[](#usage)

```
use Yearul\LaraUniqueId\LaraUniqueId; // import this in the top of the class

    $value =  LaraUniqueId::generate(2);
    echo $value;

//  generate($input,  $pad_len = null, $pad_string = null, $prefix = null, $year = null)
 // the generate method received 5 value, $input value is mandatory and others value not mandatory( thoes can get from config file)
```

Testing
-------

[](#testing)

```
composer test
```

Changelog
---------

[](#changelog)

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

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

[](#contributing)

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

Security Vulnerabilities
------------------------

[](#security-vulnerabilities)

Please review [our security policy](../../security/policy) on how to report security vulnerabilities.

Credits
-------

[](#credits)

- [Md. Yearul Islam](https://github.com/islamyearul)
- [All Contributors](../../contributors)

License
-------

[](#license)

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

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity49

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

1096d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/3f90dc9e13e6f54c5c091359406b69c36fe50da8cc260cad8e113d82674489d2?d=identicon)[islamyearul](/maintainers/islamyearul)

---

Top Contributors

[![islamyearul](https://avatars.githubusercontent.com/u/72243025?v=4)](https://github.com/islamyearul "islamyearul (8 commits)")

---

Tags

laravelyearulislamonemunique\_id\_generatorlaravel\_unique\_id\_generator

###  Code Quality

TestsPest

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/yearul-unique-id-generator/health.svg)

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

###  Alternatives

[spatie/laravel-data

Create unified resources and data transfer objects

1.7k28.9M626](/packages/spatie-laravel-data)[spatie/laravel-livewire-wizard

Build wizards using Livewire

4061.0M4](/packages/spatie-laravel-livewire-wizard)[hirethunk/verbs

An event sourcing package that feels nice.

513162.9k6](/packages/hirethunk-verbs)[worksome/exchange

Check Exchange Rates for any currency in Laravel.

123544.7k](/packages/worksome-exchange)[ralphjsmit/livewire-urls

Get the previous and current url in Livewire.

82270.3k4](/packages/ralphjsmit-livewire-urls)[hydrat/filament-table-layout-toggle

Filament plugin adding a toggle button to tables, allowing user to switch between Grid and Table layouts.

6292.3k1](/packages/hydrat-filament-table-layout-toggle)

PHPackages © 2026

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