PHP code example of phpinnacle / sequentia

1. Go to this page and download the library: Download phpinnacle/sequentia library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

phpinnacle / sequentia example snippets


use App\Models\Order;
use PHPinnacle\Sequentia\SequenceWatcher;

SequenceWatcher::register(Order::class, scheme: ['issuer_type', 'issuer_id']);

use PHPinnacle\Sequentia\Sequence;

$number = Sequence::create(
    pattern: 'ORD-[DD][MM][YY]-[SY]',
    scope: Order::class,
    bucket: ['issuer_type' => 'company', 'issuer_id' => 10],
)->forTenant($tenantId)->get();
bash
php artisan vendor:publish --tag="phpinnacle-sequentia-config"
php artisan vendor:publish --tag="phpinnacle-sequentia-migrations"
php artisan migrate
bash
php artisan sequentia:rebuild