validate([ 'name' => 'required|string', 'referral' => 'nullable|string', 'phone' => 'string', 'email' => 'nullable|email', 'gender' => 'nullable|in:LAKI-LAKI,PEREMPUAN', 'date_of_birth' => 'nullable|date' ]); try { $customer = $memberAuthRepository->register($validated); $check = $request->all(); $check["user_id"] = $customer->user_id; $auth = $memberAuthRepository->getAuth($check); return redirect('/')->with('success', 'Registration successful!'); } catch (\Exception $e) { Log::info($e); return redirect()->back()->with('error', $e->getMessage()); } } }