PHP code example of ashraam / license-generator

1. Go to this page and download the library: Download ashraam/license-generator 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/ */

    

ashraam / license-generator example snippets


$generator = new \Ashraam\LicenseGenerator\LicenseGenerator();

$generator
    ->prefix('MY-')
    ->template('XXXX-9999-X9X9')
    ->generateOne(); // MY-DESQ-4857-X6P8
    
$generator
    ->suffix('-END')
    ->template('XXXX-9999-X9X9')
    ->generateOne(); // FDIS-4572-D6D3-END

$generator
    ->lowerCase()
    ->template('XXXX-9999-X9X9')
    ->generateOne(); // qspr-5423-f5k9

$generator
    ->template('XXXX-9999')
    ->generateMany(3); // ['GDTS-4585', 'YTRH-5558', 'POGQ-4454']