MessageVerifyService.php 936 B

12345678910111213141516171819202122232425262728293031323334353637
  1. <?php
  2. namespace App\Services;
  3. use App\Services\CallApiService;
  4. class MessageVerifyService
  5. {
  6. private $callApiService;
  7. public function __construct(CallApiService $callApiService)
  8. {
  9. $this->callApiService = $callApiService;
  10. }
  11. public function send($mobileNo, $appName = 'Dabory')
  12. {
  13. $smsCert = rand(100000, 999999);
  14. $reqInfo = [
  15. 'number' => $smsCert,
  16. 'date' => date('YmdHis'),
  17. 'mobile_no' => $mobileNo
  18. ];
  19. $data = [
  20. 'title' => '본인확인',
  21. 'msg' => "[$appName] 본인확인 인증번호는 [{$smsCert}]입니다. 정확히 입력해주세요.",
  22. 'receiver' => $mobileNo,
  23. ];
  24. session()->put('smsCert', $reqInfo);
  25. // return session('smsCert.number');
  26. $request = request()->create('/dabory-app/send/text', 'POST', $data);
  27. return app()->handle($request);
  28. }
  29. }