Validation on sub-admin add form

This commit is contained in:
Ritikesh yadav
2024-05-21 13:39:12 +05:30
parent fbe01c7727
commit 76ca511a84

View File

@@ -82,7 +82,7 @@ class ManageSubAdminController extends Controller
return response()->json(['status' => 400, 'message' => $validationMessage]);
}
// $principalType = Iam_Principal_Type::find($request->role_type);
$alreadyExists = User::where(['email'=>$request->email,'contact_number'=>$request->contact_number])->exists();
$alreadyExists = User::where('email',$request->email)->orWhere('contact_number',$request->contact_number)->exists();
if($alreadyExists)
{
return response()->json(['status' => 400, 'message' =>'email or mobile number already exists']);