Exemple #1
0
 public function getInfo()
 {
     $html = '<meta charset="UTF-8"/><h2 align="center" style="margin-top: 30px;margin-bottom: 0;">Laravel Sms</h2>';
     $html .= '<p style="margin-bottom: 30px;font-size: 13px;color: #888;" align="center">' . SmsManager::VERSION . '</p>';
     $html .= '<p><a href="https://github.com/toplan/laravel-sms" target="_blank">laravel-sms源码</a>托管在GitHub,欢迎你的使用。如有问题和建议,欢迎提供issue。</p>';
     $html .= '<hr>';
     $html .= '<p>你可以在调试模式(设置config/app.php中的debug为true)下查看到存储在存储器中的验证码短信/语音相关数据:</p>';
     echo $html;
     if (config('app.debug')) {
         dump(Manager::retrieveAllData());
     } else {
         echo '<p align="center" style="color: red;">现在是非调试模式,无法查看调试数据</p>';
     }
 }
 /**
  * get notify message
  *
  * @param $name
  * @return null 
  * @static 
  */
 public static function getNotifyMessage($name)
 {
     return \Toplan\Sms\SmsManager::getNotifyMessage($name);
 }
 public function getInfo(Request $request, $token = null)
 {
     $html = '<meta charset="UTF-8"/><h2 align="center" style="margin-top: 20px;">Hello, welcome to laravel-sms v2.0</h2>';
     $html .= '<p style="color: #666;"><a href="https://github.com/toplan/laravel-sms" target="_blank">laravel-sms源码</a>托管在GitHub,欢迎你的使用。如有问题和建议,欢迎提供issue。当然你也能为该项目提供开源代码,让laravel-sms支持更多服务商。</p>';
     $html .= '<hr>';
     $html .= '<p>你可以在调试模式(设置config/app.php中的debug为true)下查看到存储在session中的验证码短信相关数据(方便你进行调试):</p>';
     echo $html;
     $token = $token ?: $request->input('token', null);
     if (config('app.debug')) {
         $smsData = SM::retrieveDebugInfo($token);
         dd($smsData);
     } else {
         echo '<p align="center" style="color: #ff0000;;">现在是非调试模式,无法查看验证码短信数据</p>';
     }
 }
Exemple #4
0
 /**
  * set template id for template sms
  * @param $agentName
  * @param $tempId
  *
  * @return $this
  */
 public function template($agentName, $tempId = null)
 {
     $tempIdArray = $this->getTemplate(true);
     if (!is_null($tempId)) {
         $tempIdArray["{$agentName}"] = $tempId;
     } else {
         if (is_array($agentName)) {
             $tempIdArray = $agentName;
         } else {
             $defaultAgentName = SM::getDefaultAgent();
             $tempIdArray["{$defaultAgentName}"] = $agentName;
         }
     }
     $this->temp_id = json_encode($tempIdArray);
     return $this;
 }