MemberSignupVerifyController.php 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. <?php
  2. namespace Themes\Pro\modunawa\app\Http\Controllers\Auth;
  3. use App\Services\MessageVerifyService;
  4. class MemberSignupVerifyController
  5. {
  6. private $messageVerifyService;
  7. public function __construct(MessageVerifyService $messageVerifyService)
  8. {
  9. $this->messageVerifyService = $messageVerifyService;
  10. }
  11. public function index()
  12. {
  13. $route = route('member-signup-verify.store');
  14. return view('views.auth.member-signup-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. session()->put('smsCert.code', 200);
  24. return redirect()->route('member-signup-branch');
  25. }
  26. public function sendCert()
  27. {
  28. $response = $this->messageVerifyService->send(request('mobile_no'));
  29. return response()->json($response);
  30. }
  31. }