myopensoft/runner

Running number manager by using database storage

1.1.9 2024-03-12 01:13 UTC

This package is auto-updated.

Last update: 2024-05-12 01:34:26 UTC


README

To generate running number that managed by database as a storage. For Laravel 5.4+, 6.0+

Installation

composer require myopensoft/runner
php artisan migrate
use MyOpensoft\Runner\Runner;

Generate number

  1. There will be 5 indexed rule ({rule_1} ... {rule_5}) and 2 non-indexed rule ({n_rule_1} and {n_rule_2}).
  2. {raw} will get raw number.
  3. {p_raw,<number>} will generate left padding from raw number.
// generate TTFN-WPPJ-(P)-000001-2020
Runner::generate("{rule_1}-{rule_2}-{n_rule_1}-{p_raw,6}-{rule_3}", "TTFM", "WPPJ", 2020, null, null, '(P)');
// generate T20022200001 | T 20 02 22 00001
Runner::generate("{rule_1}{rule_2}{rule_3}{rule_4}{p_raw,5}", "T", '20', '02', '22');

TODO

  1. Test script