PHP code example of wearesho-team / yii-token-registration

1. Go to this page and download the library: Download wearesho-team/yii-token-registration 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/ */

    

wearesho-team / yii-token-registration example snippets



// bootstrap.php

use Wearesho\Yii\Interfaces\TokenRepositoryConfigInterface;
use Wearesho\Yii\Configs\TokenRepositoryConfig;

Yii::$container->set(
    TokenRepositoryConfigInterface::class,
    [
        'class' => TokenRepositoryConfig::class,
        
        // Changing environment variables names
        'expirePeriodKey' => 'TOKEN_EXPIRE_MINUTES', // optional
        'verifyLimitKey' => 'TOKEN_VERIFY_LIMIT', // optional
        'deliveryLimitKey' => 'TOKEN_DELIVERY_LIMIT', // optional
        
        // Defaults (if no env variables set)
        'defaultExpirePeriod' => 30, // optional
        'defaultDeliveryLimit' => 3, // optional
        'defaultVerifyLimit' => 3, // optional
    ]
);