PHP code example of shiftechafrica / shift-code-generator

1. Go to this page and download the library: Download shiftechafrica/shift-code-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/ */

    

shiftechafrica / shift-code-generator example snippets


/**
 * Seed the application's database.
 *
 * @return void
 */
public function run()
{
     // Other seeds...
     $this->call(\ShiftechAfrica\CodeGenerator\Seeds\ShiftCodeGeneratorFactory::class);
}

use ShiftechAfrica\CodeGenerator\ShiftCodeGenerator;

/**
 * Generate a new Shift Code
 * 
 * @return string
 */
public function generateCode()
{
    return (new ShiftCodeGenerator())->generate(); 
    // Optionally pass an integer to set the random length, e.g. ->generate(5)
}
bash
composer dump-autoload
bash
php artisan vendor:publish --provider="ShiftechAfrica\CodeGenerator\ShiftCodeGeneratorServiceProvider"

config/shift-code-generator.php