Fix phone_verification.is_verified column name to match V1 exactly
This commit is contained in:
@@ -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',
|
||||
|
||||
Reference in New Issue
Block a user