lyrasoft / sequence
LYRASOFT sequence package.
Installs: 1 806
Dependents: 2
Suggesters: 0
Security: 0
Stars: 1
Watchers: 3
Forks: 0
Open Issues: 0
Type:windwalker-package
Requires
- myclabs/php-enum: ^1.8
This package is auto-updated.
Last update: 2024-11-12 10:28:58 UTC
README
To get unique serial numbers for any record.
Installation
Install from composer
composer require lyrasoft/sequence
Then copy files to project
php windwalker pkg:install lyrasoft/sequence -t migrations
You must manually add SequencePackage::class
to etc/di.php
// ... 'providers' => [ \Lyrasoft\Sequence\SequencePackage::class ], // ...
Usage
$sequenceServcie = $app->service(\Lyrasoft\Sequence\Service\SequenceService::class); $serial = $sequenceServcie->getNextSerial('order', 'FN-'); // 15 $serial = $sequenceServcie->getNextSerialAndPadZero('order', 'FN-', 7); // 0000015 $serial = $sequenceServcie->getNextSerialWithPrefix('order', 'FN-', 7); // FN-0000015