Update case sensitif
This commit is contained in:
@@ -30,9 +30,9 @@ class AuthDoctorController extends Controller
|
||||
'email' => 'required|email',
|
||||
'password' => 'required'
|
||||
], [
|
||||
'email.required' => trans('validation.required',['attribute' => 'Email']),
|
||||
'email.email' => trans('validation.email'),
|
||||
'password.required' => trans('validation.required',['attribute' => 'Password']),
|
||||
'email.required' => trans('Validation.required',['attribute' => 'Email']),
|
||||
'email.email' => trans('Validation.email'),
|
||||
'password.required' => trans('Validation.required',['attribute' => 'Password']),
|
||||
]);
|
||||
|
||||
if ($validator->fails())
|
||||
@@ -43,11 +43,11 @@ class AuthDoctorController extends Controller
|
||||
{
|
||||
$user = User::where('email', $request->email)->first();
|
||||
if (!$user) {
|
||||
return ApiResponse::apiResponse('Not Found', $data, trans('message.not_found'), 404);
|
||||
return ApiResponse::apiResponse('Not Found', $data, trans('Message.not_found'), 404);
|
||||
}
|
||||
|
||||
if (!Hash::check($request->password, $user->password)) {
|
||||
return ApiResponse::apiResponse('Bad Request', $data, trans('message.password'), 400);
|
||||
return ApiResponse::apiResponse('Bad Request', $data, trans('Message.password'), 400);
|
||||
}
|
||||
|
||||
$res_data = [
|
||||
@@ -55,7 +55,7 @@ class AuthDoctorController extends Controller
|
||||
'token' => $user->createToken('app')->plainTextToken
|
||||
];
|
||||
|
||||
return ApiResponse::apiResponse("Success", $res_data, trans('message.success'), 200);
|
||||
return ApiResponse::apiResponse("Success", $res_data, trans('Message.success'), 200);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -63,7 +63,7 @@ class AuthDoctorController extends Controller
|
||||
{
|
||||
$request->user()->tokens()->delete();
|
||||
|
||||
return ApiResponse::apiResponse('Success', [], trans('message.logout'), 200);
|
||||
return ApiResponse::apiResponse('Success', [], trans('Message.logout'), 200);
|
||||
}
|
||||
|
||||
public function forgotPassword(Request $request)
|
||||
@@ -75,8 +75,8 @@ class AuthDoctorController extends Controller
|
||||
$validator = Validator::make($request->all(), [
|
||||
'email' => 'required|email',
|
||||
], [
|
||||
'email.required' => trans('validation.required',['attribute' => 'Email']),
|
||||
'email.email' => trans('validation.email'),
|
||||
'email.required' => trans('Validation.required',['attribute' => 'Email']),
|
||||
'email.email' => trans('Validation.email'),
|
||||
]);
|
||||
|
||||
if ($validator->fails())
|
||||
@@ -87,7 +87,7 @@ class AuthDoctorController extends Controller
|
||||
{
|
||||
$user = User::where('email', $request->email)->first();
|
||||
if (!$user) {
|
||||
return ApiResponse::apiResponse('Not Found', $data, trans('message.not_found'), 404);
|
||||
return ApiResponse::apiResponse('Not Found', $data, trans('Message.not_found'), 404);
|
||||
}
|
||||
|
||||
//send email
|
||||
@@ -131,11 +131,11 @@ class AuthDoctorController extends Controller
|
||||
->where('token', '=', $token)
|
||||
->get();
|
||||
|
||||
return ApiResponse::apiResponse("Success", $res, trans('message.success'), 200);
|
||||
return ApiResponse::apiResponse("Success", $res, trans('Message.success'), 200);
|
||||
}
|
||||
else
|
||||
{
|
||||
return ApiResponse::apiResponse("Internal Server Error", $data, trans('message.server_error'), 500);
|
||||
return ApiResponse::apiResponse("Internal Server Error", $data, trans('Message.server_error'), 500);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -151,9 +151,9 @@ class AuthDoctorController extends Controller
|
||||
'email' => 'required|email',
|
||||
'token' => 'required|numeric',
|
||||
], [
|
||||
'email.required' => trans('validation.required',['attribute' => 'Email']),
|
||||
'email.email' => trans('validation.email'),
|
||||
'token.required' => trans('validation.required',['attribute' => 'Token']),
|
||||
'email.required' => trans('Validation.required',['attribute' => 'Email']),
|
||||
'email.email' => trans('Validation.email'),
|
||||
'token.required' => trans('Validation.required',['attribute' => 'Token']),
|
||||
]);
|
||||
|
||||
if ($validator->fails())
|
||||
@@ -178,15 +178,15 @@ class AuthDoctorController extends Controller
|
||||
$diffInMinutes = ($now - $created_at) / 60;
|
||||
|
||||
if ($diffInMinutes > 60) {
|
||||
return ApiResponse::apiResponse('Not Found', $data, trans('message.token_expired'), 404);
|
||||
return ApiResponse::apiResponse('Not Found', $data, trans('Message.token_expired'), 404);
|
||||
} else {
|
||||
// Lanjutkan dengan proses pemulihan kata sandi
|
||||
return ApiResponse::apiResponse("Success", $data, trans('message.success'), 200);
|
||||
return ApiResponse::apiResponse("Success", $data, trans('Message.success'), 200);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return ApiResponse::apiResponse('Not Found', $data, trans('message.not_found'), 404);
|
||||
return ApiResponse::apiResponse('Not Found', $data, trans('Message.not_found'), 404);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -208,12 +208,12 @@ class AuthDoctorController extends Controller
|
||||
'regex:/^(?=.*[a-z])(?=.*[A-Z])(?=.*\d).{8,}$/'
|
||||
]
|
||||
], [
|
||||
'email.required' => trans('validation.required',['attribute' => 'Email']),
|
||||
'email.email' => trans('validation.email'),
|
||||
'token.required' => trans('validation.required',['attribute' => 'Token']),
|
||||
'new_password.required' => trans('validation.required',['attribute' => 'New Password']),
|
||||
'new_password.min' => trans('validation.min',['attribute' => 'New Password']),
|
||||
'new_password.regex' => trans('validation.regex',['attribute' => 'New Password']),
|
||||
'email.required' => trans('Validation.required',['attribute' => 'Email']),
|
||||
'email.email' => trans('Validation.email'),
|
||||
'token.required' => trans('Validation.required',['attribute' => 'Token']),
|
||||
'new_password.required' => trans('Validation.required',['attribute' => 'New Password']),
|
||||
'new_password.min' => trans('Validation.min',['attribute' => 'New Password']),
|
||||
'new_password.regex' => trans('Validation.regex',['attribute' => 'New Password']),
|
||||
]);
|
||||
|
||||
if ($validator->fails())
|
||||
@@ -238,7 +238,7 @@ class AuthDoctorController extends Controller
|
||||
$diffInMinutes = ($now - $created_at) / 60;
|
||||
|
||||
if ($diffInMinutes > 60) {
|
||||
return ApiResponse::apiResponse('Not Found', $data, trans('message.token_expired'), 404);
|
||||
return ApiResponse::apiResponse('Not Found', $data, trans('Message.token_expired'), 404);
|
||||
} else {
|
||||
// Lanjutkan dengan proses pemulihan kata sandi
|
||||
$user = User::where('email', $request->email)->first();
|
||||
@@ -247,17 +247,17 @@ class AuthDoctorController extends Controller
|
||||
$newPassword = Hash::make($request->new_password);
|
||||
$user->password = $newPassword;
|
||||
$user->save();
|
||||
return ApiResponse::apiResponse("Success", $data, trans('message.success'), 200);
|
||||
return ApiResponse::apiResponse("Success", $data, trans('Message.success'), 200);
|
||||
}
|
||||
else
|
||||
{
|
||||
return ApiResponse::apiResponse('Not Found', $data, trans('message.token_expired'), 404);
|
||||
return ApiResponse::apiResponse('Not Found', $data, trans('Message.token_expired'), 404);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return ApiResponse::apiResponse('Not Found', $data, trans('message.not_found'), 404);
|
||||
return ApiResponse::apiResponse('Not Found', $data, trans('Message.not_found'), 404);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -137,7 +137,7 @@ class ProfileDoctorController extends Controller
|
||||
];
|
||||
$res_data['dataSip'] = $dataSip;
|
||||
|
||||
return ApiResponse::apiResponse("Success", $res_data, trans('message.success'), 200);
|
||||
return ApiResponse::apiResponse("Success", $res_data, trans('Message.success'), 200);
|
||||
|
||||
}
|
||||
public function fWorkExperience($start, $end)
|
||||
|
||||
Reference in New Issue
Block a user