|
|
|
@ -60,6 +60,10 @@ class HumanResourceController extends Controller
|
|
|
|
|
if(isset($request->password) && $request->password!="" ){ |
|
|
|
|
$data['password'] = md5($request->password); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if(isset($data['username']) && HumanResource::where('username', $data['username'])->where('id', '<>', $id)->exists()){ |
|
|
|
|
return response()->json(['status'=>'failed','message'=>'Username already exists!','code'=>400], 400); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if($humanresource){ |
|
|
|
|
$result = $humanresource->update($data); |
|
|
|
|