Filter nokp without hyphen when register

This commit is contained in:
Amir
2022-12-14 07:31:03 +08:00
parent 193a440daf
commit 3fa6617de4
@@ -38,7 +38,9 @@ class AuthController extends Controller
$fields = $validator->validated();
$convert_ic_to_hyphen = (substr_replace(substr_replace($fields['nokp'], '-', 6, 0), '-', 9, 0));
$check_staff = Staff::where('nokp', '=', $convert_ic_to_hyphen)->first();
$check_staff = Staff::where('nokp', '=', $convert_ic_to_hyphen)
->orWhere('nokp', '=', $fields['nokp'])
->first();
if($check_staff)
{
$errors = [
@@ -49,7 +51,6 @@ class AuthController extends Controller
}
$currentdate = Carbon::now();
$currentdate = $currentdate->toDateString();