Download the PHP package welman91/filament-record-number-generator without Composer

On this page you can find all versions of the php package welman91/filament-record-number-generator. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package filament-record-number-generator

Filament Record Number Generator

Configurable auto-numbering for any Eloquent model in Filament (v4, v5) . Supports patterns like INV-2026-0001, PO/{branch}/{sequence}, per-tenant sequences, fiscal year resets, gap-free mode, and prefix/suffix rules.

Installation

Add the package to your Laravel project:

Publish and run the migrations:

Optionally publish the config file:

Setup

1. Register the Plugin

Add the plugin to your Filament panel provider:

2. Add the Trait to Your Models

Add HasNumbering to any model that needs auto-numbering:

3. Create a Numbering Sequence

Navigate to Settings > Numbering Sequences in your Filament panel and create a sequence, or insert one directly:

Now every time an Invoice is created, the invoice_number attribute is automatically filled (e.g. INV-2026-0001, INV-2026-0002, ...).

Pattern Tokens

Token Example Output Description
{sequence} 0001 Zero-padded sequence (default 4 digits)
{sequence:N} 000001 Zero-padded to N digits
{year} 2026 4-digit year
{year:2} 26 2-digit year
{month} 04 Zero-padded month
{day} 07 Zero-padded day
{prefix} INV- Value from the sequence's prefix column
{suffix} -A Value from the sequence's suffix column
{attribute:name} Acme Model attribute (supports dot notation for relations)

Example Patterns

Pattern Output
INV-{year}-{sequence:4} INV-2026-0001
PO/{attribute:branch.code}/{sequence:5} PO/HQ/00001
{prefix}{year:2}{month}-{sequence:3}{suffix} CR-2604-001-A
REC-{sequence:6} REC-000001

Custom Token Aliases

You can define custom token names that map to built-in resolvers, either via the admin UI or in the custom_tokens JSON column:

Custom Token Resolvers

Create a class implementing TokenResolver for completely custom logic:

Register it in config/filament-record-number-generator.php:

Then use {dept} in your patterns.

Reset Frequency

Frequency Behavior
never Counter never resets — continuous numbering
yearly Resets at the start of each fiscal year
monthly Resets at the start of each month
daily Resets at the start of each day

Fiscal Year

When reset_frequency is yearly, the fiscal_year_start_month determines when the year rolls over:

Gap-Free Mode

When is_gap_free is true, the package uses database row-level locking (SELECT ... FOR UPDATE) to guarantee no gaps in the sequence. The counter increment and model save happen within the same transaction — if the save fails, the counter rolls back.

Trade-off: Gap-free mode serializes concurrent requests for the same sequence. Use it only when regulatory or business requirements demand unbroken sequences (e.g. invoice numbers).

When is_gap_free is false (default), an atomic increment is used. Gaps may occur if a model creation fails after the counter is incremented, but throughput is higher.

Per-Tenant Isolation

Each numbering sequence is scoped by company_id. Two companies with the same sequence pattern maintain independent counters:

Set company_id to null for a global sequence shared across all tenants.

Manual Override

If a model's numbered attribute is already filled before creation, the trait skips auto-generation. This allows manual number entry when needed:

Programmatic Usage

Generate a Number

Preview the Next Number

Returns what the next number will be without consuming a counter value:

On the Model

Events

The NumberGenerated event is dispatched after each number is generated:

Plugin Configuration

Method Description
sequenceResource(false) Disable the Numbering Sequences resource in the panel
navigationGroup('Admin') Change the navigation group

Config File

After publishing, the config is at config/filament-record-number-generator.php:

Key Default Description
default_pattern {prefix}{year}-{sequence:4}{suffix} Default pattern for new sequences
default_reset_frequency yearly Default reset frequency
default_fiscal_year_start_month 1 Default fiscal year start
default_gap_free false Default gap-free mode
navigation_group Settings Filament navigation group
custom_resolvers [] Custom token resolver classes

Localization

The package ships with English and Arabic translations. Publish them to customize:

Testing

License

MIT


All versions of filament-record-number-generator with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
filament/filament Version ^5.0
spatie/laravel-package-tools Version ^1.15.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package welman91/filament-record-number-generator contains the following files

Loading the files please wait ...