Skip to content

lyrasoft/luna-sequence

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LYRASOFT Sequence Package

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

About

Luna 套件: 編號序列

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages