thomzee / numbros
Generate invoice number, order code, or receipt number easily with dynamic format and pattern for PHP Laravel framework.
v1.0.0
2021-10-04 16:06 UTC
This package is auto-updated.
Last update: 2024-10-16 09:27:56 UTC
README
This package allows you to generate invoice number dynamically with designated pattern. Current available pattern is:
- Roman Pattern (INV/20211004/MMXXI/X/IV/12345)
- Number Pattern (INV2021100412345)
Other patterns is under development ...
Installation
- Install via composer by running this code on command line inside Laravel project
composer require thomzee/numbros
- Add this line to your
app.php
file'providers' => [ . . . Thomzee\Numbros\NumbrosServiceProvider::class, ]
- Add the facade as well in the same file
'aliases' => [ . . . 'Laramap' => Thomzee\Numbros\Facades\Numbros::class, ]
Usage
Roman Pattern
$numbros = new Numbros(); $numbros->generate('roman', 'inv', '12345');
Number Pattern
$numbros = new Numbros(); $numbros->generate('number', 'inv', '12345', '');
generate()
This function contains 5 parameters
- Type, should contain pattern type available above
- Prefix, e.g.: INV, DSB, ORD, etc
- Unique, must be a unique
- Separator, can be '/', '-', '', etc to separate sections
- Uppercase, determine end result characters case