mirror of
https://gitlab.com/omair-personal/exchange.git
synced 2026-08-19 12:34:13 +00:00
fix validation error
This commit is contained in:
@@ -64,15 +64,17 @@ class RegisterController extends Controller
|
||||
$marking = Marking::Where('email',$data['email'])->first();
|
||||
|
||||
if(!$marking){
|
||||
return response()->json('Does not exist ', 400);
|
||||
return response()->json(["message"=>"Does not exist"], 400);
|
||||
}
|
||||
if($marking->marking != $data['marking']){
|
||||
return response()->json('Incorrect marking', 400);
|
||||
return response()->json(["message"=>"Incorrect marking"], 400);
|
||||
}
|
||||
|
||||
if(User::Where('email',$data['email'])->first()){
|
||||
return response()->json('Email already exist in the system', 400);
|
||||
return response()->json(["message"=>"Email already exist in the system"], 400);
|
||||
}
|
||||
|
||||
|
||||
|
||||
$role = Role::where('name','=','member')->first();
|
||||
$user = new User();
|
||||
|
||||
Reference in New Issue
Block a user