update api register

This commit is contained in:
Wian Drs
2026-08-01 11:42:42 +07:00
parent b0d08211ec
commit 75342dc7b7
55 changed files with 2254 additions and 35 deletions
+8 -4
View File
@@ -19,6 +19,8 @@ class AuthService
'whatsapp_number' => $data['whatsapp_number'],
'password' => Hash::make($data['password']),
'is_master' => false,
'is_platform_staff' => false,
'access_level' => 'customer',
'status' => 'inactive',
'verification_channel' => $data['verification_channel'],
'verification_target' => $data['verification_target'],
@@ -32,7 +34,8 @@ class AuthService
'verification' => [
'channel' => $user->verification_channel,
'target' => $user->verification_target,
'code' => $code,
'code' => config('registration.show_verification_code') ? $code : null,
'code_visible' => (bool) config('registration.show_verification_code'),
'expires_at' => $user->verification_code_expires_at,
],
];
@@ -45,7 +48,7 @@ class AuthService
->where('verification_target', $data['verification_target'])
->first();
if (!$user) {
if (! $user) {
throw ValidationException::withMessages([
'verification_target' => 'Target verifikasi tidak ditemukan.',
]);
@@ -83,7 +86,7 @@ class AuthService
->where('verification_target', $data['verification_target'])
->first();
if (!$user) {
if (! $user) {
throw ValidationException::withMessages([
'verification_target' => 'Target verifikasi tidak ditemukan.',
]);
@@ -105,7 +108,8 @@ class AuthService
return [
'channel' => $user->verification_channel,
'target' => $user->verification_target,
'code' => $code,
'code' => config('registration.show_verification_code') ? $code : null,
'code_visible' => (bool) config('registration.show_verification_code'),
'expires_at' => $user->verification_code_expires_at,
];
}