Merge pull request #4009 from JunaidJaved8461/JJ
Fixed #3974 (Validation Message Shown now)
This commit is contained in:
commit
e08d41ae0c
|
|
@ -103,23 +103,19 @@ class SessionController extends Controller
|
||||||
'password' => 'confirmed|min:6',
|
'password' => 'confirmed|min:6',
|
||||||
]);
|
]);
|
||||||
|
|
||||||
$data = request()->all();
|
$data = request()->only('first_name', 'last_name', 'gender', 'date_of_birth', 'email', 'password');
|
||||||
|
|
||||||
if (! $data['date_of_birth']) {
|
if (! isset($data['password']) || ! $data['password']) {
|
||||||
unset($data['date_of_birth']);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!isset($data['password']) || ! $data['password']) {
|
|
||||||
unset($data['password']);
|
unset($data['password']);
|
||||||
} else {
|
} else {
|
||||||
$data['password'] = bcrypt($data['password']);
|
$data['password'] = bcrypt($data['password']);
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->customerRepository->update($data, $customer->id);
|
$updatedCustomer = $this->customerRepository->update($data, $customer->id);
|
||||||
|
|
||||||
return response()->json([
|
return response()->json([
|
||||||
'message' => 'Your account has been created successfully.',
|
'message' => 'Your account has been updated successfully.',
|
||||||
'data' => new CustomerResource($this->customerRepository->find($customer->id)),
|
'data' => new CustomerResource($updatedCustomer),
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue