FindMemberIdVerifyController.php 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. <?php
  2. namespace Themes\kbgolf\pro\app\Http\Controllers\Auth;
  3. use App\Services\MessageVerifyService;
  4. class FindMemberIdVerifyController
  5. {
  6. private $messageVerifyService;
  7. public function __construct(MessageVerifyService $messageVerifyService)
  8. {
  9. $this->messageVerifyService = $messageVerifyService;
  10. }
  11. public function index()
  12. {
  13. $route = route('find-member-id-verify.store');
  14. return view('views.auth.find-member-id-verify', compact('route'));
  15. }
  16. public function store()
  17. {
  18. if (request('cert_number') != session('smsCert.number')) {
  19. notify()->error(_e('Action failed'), 'Error', 'bottomRight');
  20. return redirect()->back();
  21. }
  22. session()->forget('smsCert.number');
  23. // 200: 회원가입, 201: 아이디 찾기
  24. session()->put('smsCert.code', 201);
  25. return redirect()->route('find-member-id.index');
  26. }
  27. public function sendCert()
  28. {
  29. $response = $this->messageVerifyService->send(request('mobile_no'));
  30. return response()->json($response);
  31. }
  32. }