Validation on sub-admin add form
This commit is contained in:
@@ -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']);
|
||||
|
||||
Reference in New Issue
Block a user