PHP code example of azaharizaman / nexus-sequencing
1. Go to this page and download the library: Download azaharizaman/nexus-sequencing 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/ */
azaharizaman / nexus-sequencing example snippets
use Nexus\Sequencing\Services\SequenceManager;
// Inject via dependency injection
public function __construct(
private readonly SequenceManager $sequenceManager
) {}
// Generate the next number
$invoiceNumber = $this->sequenceManager->generate(
sequenceName: 'invoice_number',
scopeIdentifier: 'tenant_123',
contextVariables: [
'DEPARTMENT' => 'SALES',
]
);
// Result: "INV-2025-SALES-00001"