1
0
mirror of https://gitee.com/koogua/course-tencent-cloud.git synced 2025-06-30 14:14:55 +08:00
2020-04-21 19:23:20 +08:00

33 lines
576 B
PHP

<?php
namespace App\Services\Smser;
use App\Services\Smser;
use App\Services\Verification;
class Verify extends Smser
{
protected $templateCode = 'verify';
/**
* @param string $phone
* @return bool
*/
public function handle($phone)
{
$verification = new Verification();
$minutes = 5;
$code = $verification->getSmsCode($phone, 60 * $minutes);
$templateId = $this->getTemplateId($this->templateCode);
$params = [$code, $minutes];
return $this->send($phone, $templateId, $params);
}
}