我有一些字段想以加密形式插入数据中,我可以将数据保存为加密形式,但是我的其他数据没有更新/插入,例如城市,州,邮编和地址。
我不知道我在哪里做错了:
我的控制器代码:
try {
$profile = $this->doctorModel->find($doctorProfile['id']);
$request->request->add(['updated_by' => Auth::user()->id]);
$profile->city = Input::get('city');
$profile->state = Input::get('state');
$profile->zip = Input::get('zip');
$profile->address = Input::get('address');
$profile->registration_number = encrypt($request->registration_number);
$profile->dea_number = encrypt($request->dea_number);
$profile->npi_number = encrypt($request->npi_number);
$profile->upin = encrypt($request->upin);
$profile->save();
return response(['status' => true, 'message' => 'Doctor Data Updated Successfully'], 200);
} catch (\Exception $ex) {
return response(['status' => false, 'message' => 'Validation Errors', 'errors' => $ex->getMessage()]);
}
}
如您所见,city,state和zip不在数据库中插入/更新,但加密值以加密形式插入数据库中。
我们将非常感谢您的帮助!
Request {#39
#json: ParameterBag {#21
#parameters: array:2 [
"doctor_profile" => array:32 [
"id" => 3
"clinic_name" => "Mayo Hospital12301"
"first_name" => "Dr. Brain17"
"middle_name" => "Shahzad"
"last_name" => "David"
"cell_phone_no" => "111-111-1111"
"phone_extension" => 123
"doc_email" => "rajaunleashed@gmail.com"
"fax" => "111-111-1111"
"ssn" => "321"
"address" => "Islamabad G9"
"state" => "Federal"
"city" => "Islamabad"
"zip" => "24711"
"npi" => 123123
"speciality_id" => 2
"medical_credentials" => 0
"registration_number" => "0-98-98"
"registration_expiration_date" => "2019-01-01"
"dea_number" => "1-0-97-120"
"dea_expiration_date" => "2019-01-01"
"dea_issue_date" => "2019-01-01"
"npi_number" => "0-987-124"
"billing_title" => "SHAHZAD"
"billing_employment_type" => "Contractor"
"please_specify" => "Un-Employment"
"nadean_number" => "90-87-1455"
"upin" => "65-98-1011"
"wcb_authorization" => "14-987-1"
"wcb_rating_code" => "9"
"wcb_date_of_issue" => "2019-01-01"
"hospital_privileges" => "can_access_patient"
]
"updated_by" => 5
]
}