Fix phone_verification.is_verified column name to match V1 exactly

This commit is contained in:
Hamza-Ayed
2026-04-25 12:16:27 +03:00
parent b85e49f4b8
commit 67c5043426
2 changed files with 6 additions and 17 deletions

View File

@@ -294,22 +294,11 @@ class OtpController extends Controller
return $this->failure('Phone parameter is missing', 400);
}
try {
$verified = DB::connection('primary')->table('phone_verification')
->where('phone_number', $phone)
->where('verified', 1) // In V1 it might be 'verified' or 'is_verified'
->exists();
} catch (\Exception $e) {
// Fallback for column name 'is_verified' if 'verified' fails
try {
$verified = DB::connection('primary')->table('phone_verification')
->where('phone_number', $phone)
->where('is_verified', 1)
->exists();
} catch (\Exception $e2) {
$verified = false;
}
}
// Match V1 exact column name: is_verified
$verified = DB::connection('primary')->table('phone_verification')
->where('phone_number', $phone)
->where('is_verified', 1)
->exists();
return response()->json([
'status' => 'success',