Files
shipping-portal/app/Classes/Modules/Wallets/Services/GeneratesWalletTransactionBillNo.php
T

27 lines
537 B
PHP

<?php
namespace App\Classes\Modules\Wallets\Services;
class GeneratesWalletTransactionBillNo
{
private $walletTransationBillNoExists;
public function __construct(ChecksIfWalletTransactionBillNoExists $walletTransationBillNoExists)
{
$this->walletTransationBillNoExists = $walletTransationBillNoExists;
}
public function execute(): int {
$code = mt_rand(100000001, 999999999);
return !$this->walletTransationBillNoExists->execute($code) ? $code : self::execute();
}
}