diff --git a/app/Http/Controllers/UserController.php b/app/Http/Controllers/UserController.php index 27fe2f6..2e099b7 100644 --- a/app/Http/Controllers/UserController.php +++ b/app/Http/Controllers/UserController.php @@ -231,21 +231,21 @@ public function register(Request $request) $code = rand(1000, 9999); $token = Str::random(64); // ✅ Check if email can receive a message before creating the user - if (isset($data['email'])) { - $code = rand(1000, 9999); - try { - if ($method === 'code') { - \Mail::to($data['email'])->send(new \App\Mail\VerifyEmailCodeMail($code)); - } else { - $verificationUrl = url("api/auth/verify-email-link/{$token}?package={$packageNameValue}"); - \Mail::to($data['email'])->send(new \App\Mail\VerifyEmailLinkMail($verificationUrl)); - } - } catch (\Exception $e) { - return response()->json([ - 'error' => $e->getMessage(), - 'message' => 'لطفا آدرس ایمیل خود را بررسی کنید و مجدد تلاش کنید' - ], 400); - } + // if (isset($data['email'])) { + // $code = rand(1000, 9999); + // try { + // if ($method === 'code') { + // \Mail::to($data['email'])->send(new \App\Mail\VerifyEmailCodeMail($code)); + // } else { + // $verificationUrl = url("api/auth/verify-email-link/{$token}?package={$packageNameValue}"); + // \Mail::to($data['email'])->send(new \App\Mail\VerifyEmailLinkMail($verificationUrl)); + // } + // } catch (\Exception $e) { + // return response()->json([ + // 'error' => $e->getMessage(), + // 'message' => 'لطفا آدرس ایمیل خود را بررسی کنید و مجدد تلاش کنید' + // ], 400); + // } // try { // // Try sending email // \Mail::to($data['email'])->send(new \App\Mail\VerifyEmailCodeMail($code)); @@ -257,7 +257,7 @@ public function register(Request $request) // ], 400); // } - } +// } // Hash password $data['password'] = isset($data['password'])