PHPackages                             tfsthiagobr98/laravel-naming-series - 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. tfsthiagobr98/laravel-naming-series

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

tfsthiagobr98/laravel-naming-series
===================================

Generate Custom Ids for your models

2.1.0(1y ago)0838—10%[2 PRs](https://github.com/TFSThiagoBR98/laravel-naming-series/pulls)MITPHPPHP ^8.3CI failing

Since Jan 16Pushed 1y ago1 watchersCompare

[ Source](https://github.com/TFSThiagoBR98/laravel-naming-series)[ Packagist](https://packagist.org/packages/tfsthiagobr98/laravel-naming-series)[ Docs](https://github.com/tfsthiagobr98/laravel-naming-series)[ GitHub Sponsors](https://github.com/TFSThiagoBR98)[ RSS](/packages/tfsthiagobr98-laravel-naming-series/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (3)Dependencies (13)Versions (7)Used By (0)

Generate Custom Ids for your models
===================================

[](#generate-custom-ids-for-your-models)

[![Latest Version on Packagist](https://camo.githubusercontent.com/c8a96dd396eaf14db7cc386fee5b390ad955a7ab286c5b60d46ca24a2d749636/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f74667374686961676f627239382f6c61726176656c2d6e616d696e672d7365726965732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/tfsthiagobr98/laravel-naming-series)[![GitHub Tests Action Status](https://camo.githubusercontent.com/8e8514077ed057f79c21e637f401f1a49fde0d61030b7bfe9d09f822c033e530/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f74667374686961676f627239382f6c61726176656c2d6e616d696e672d7365726965732f72756e2d74657374732e796d6c3f6272616e63683d6d61696e266c6162656c3d7465737473267374796c653d666c61742d737175617265)](https://github.com/tfsthiagobr98/laravel-naming-series/actions?query=workflow%3Arun-tests+branch%3Amain)[![GitHub Code Style Action Status](https://camo.githubusercontent.com/a55687878932255914918955a790c683d85265eaa75a4d8393c533734847ce7f/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f74667374686961676f627239382f6c61726176656c2d6e616d696e672d7365726965732f6669782d7068702d636f64652d7374796c652d6973737565732e796d6c3f6272616e63683d6d61696e266c6162656c3d636f64652532307374796c65267374796c653d666c61742d737175617265)](https://github.com/tfsthiagobr98/laravel-naming-series/actions?query=workflow%3A%22Fix+PHP+code+style+issues%22+branch%3Amain)[![Total Downloads](https://camo.githubusercontent.com/3a625603ba1770fe56f30e335d2ce5b95c981dc9747e1c2a7229558b079f71ae/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f74667374686961676f627239382f6c61726176656c2d6e616d696e672d7365726965732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/tfsthiagobr98/laravel-naming-series)

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 tfsthiagobr98/laravel-naming-series
```

You can publish and run the migrations with:

```
php artisan vendor:publish --tag="laravel-naming-series-migrations"
php artisan migrate
```

You can publish the config file with:

```
php artisan vendor:publish --tag="laravel-naming-series-config"
```

This is the contents of the published config file:

```
return [
    'database' => [
        'connection' => null,
        'table' => 'naming_series',
    ],
    'split_with' => '.',
    'initial_increment' => 1000,
];
```

Usage
-----

[](#usage)

```
use TFSThiagoBR98\LaravelNamingSeries\Contracts\HasNamingSeries;
use TFSThiagoBR98\LaravelNamingSeries\Concerns\UsingNamingSeries;

class Contract extends Model implements HasNamingSeries
{
    use UsingNamingSeries;

    /**
     * Indicates if the model uses unique ids.
     *
     * @var bool
     */
    public $usesUniqueIds = true;

    /**
     * Field => Format list for model fields
     *
     * @var array
     */
    public static function getSerieList(): array
    {
        return [
            'code' => 'CNT-.YY.MM.####',
        ];
    }

    /**
     * Get the columns that should receive a unique identifier.
     *
     * @return array
     */
    public function uniqueIds()
    {
        return [
            'code' => 'getSeriesField', // your series field
        ];
    }
```

### Avaliable Aliases

[](#avaliable-aliases)

The Serie format must be splited in part with `.` character. For example: `CNT-.YY.MM.####` where: `CNT-` is a literal string, `YY` and `MM` is a variable and `####` is the sequential number.

- `#`: Numeric Sequence ()
- `YY`: Year (2 Digits)
- `YYYY`: Year (4 Digits)
- `MM`: Month
- `MM`: Day
- `WW`: ISO Week Count
- `TS`: Timestamp (Miliseconds)
- `TL`: Timestamp (Seconds)

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)

- [Thiago França da Silva](https://github.com/TFSThiagoBR98)
- [All Contributors](../../contributors)

License
-------

[](#license)

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

###  Health Score

36

—

LowBetter than 82% of packages

Maintenance44

Moderate activity, may be stable

Popularity18

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity61

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

Every ~137 days

Total

4

Last Release

436d ago

Major Versions

1.x-dev → 2.0.02024-03-14

PHP version history (2 changes)1.0.0PHP ^8.1

2.0.0PHP ^8.3

### Community

Maintainers

![](https://www.gravatar.com/avatar/4f8b7219158e12dabe52f2b5cdbb3f20ddd36cebc2416ce01e7517237203bd91?d=identicon)[tfsthiagobr98](/maintainers/tfsthiagobr98)

---

Top Contributors

[![TFSThiagoBR98](https://avatars.githubusercontent.com/u/16943898?v=4)](https://github.com/TFSThiagoBR98 "TFSThiagoBR98 (26 commits)")

---

Tags

laravelThiago França da Silvalaravel-naming-series

###  Code Quality

TestsPest

Static AnalysisPHPStan

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/tfsthiagobr98-laravel-naming-series/health.svg)

```
[![Health](https://phpackages.com/badges/tfsthiagobr98-laravel-naming-series/health.svg)](https://phpackages.com/packages/tfsthiagobr98-laravel-naming-series)
```

###  Alternatives

[spatie/laravel-data

Create unified resources and data transfer objects

1.7k28.9M627](/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)
