diff --git a/app/Livewire/HealthCare/AddMedicalRecords.php b/app/Livewire/HealthCare/AddMedicalRecords.php index 0fa0914..89eb901 100644 --- a/app/Livewire/HealthCare/AddMedicalRecords.php +++ b/app/Livewire/HealthCare/AddMedicalRecords.php @@ -5,6 +5,7 @@ use App\Models\MedicalRecord; use App\Models\PatientAppointment; use Illuminate\Support\Facades\Auth; +use Illuminate\Support\Facades\Crypt; use Illuminate\Support\Facades\Gate; use Livewire\Attributes\Title; use Livewire\Attributes\Validate; @@ -45,13 +46,13 @@ public function add() { 'patient_id' => $this -> patient_id, // Note: only doctors should be able to add records so set policy for that 'user_id' => Auth::user() -> id, - 'visit_reason' => $this -> visit_reason, - 'diagnosis' => $this -> diagnosis, - 'treatment' => $this -> treatment, - 'prescription' => $this -> prescriptions, + 'visit_reason' => Crypt::encryptString($this -> visit_reason), + 'diagnosis' => Crypt::encryptString($this -> diagnosis), + 'treatment' => Crypt::encryptString($this -> treatment), + 'prescription' => Crypt::encryptString($this -> prescriptions), 'visit_date' => date('Y-m-d'), 'follow_up_date' => $this -> follow_up_date, - 'notes' => $this -> notes + 'notes' => Crypt::encryptString($this -> notes) ]; // Insert the data into the MedicalRecords table diff --git a/resources/views/livewire/health-care/view-patient-data.blade.php b/resources/views/livewire/health-care/view-patient-data.blade.php index 2da5f41..bf00152 100644 --- a/resources/views/livewire/health-care/view-patient-data.blade.php +++ b/resources/views/livewire/health-care/view-patient-data.blade.php @@ -37,26 +37,26 @@

Visit Reason

-

{{ $record -> visit_reason }}

+

{{ \Illuminate\Support\Facades\Crypt::decryptString($record -> visit_reason) }}

Diagnosis

-

{{ $record -> diagnosis }}

+

{{ \Illuminate\Support\Facades\Crypt::decryptString($record -> diagnosis) }}

Treatment

-

{{ $record -> treatment }}

+

{{ \Illuminate\Support\Facades\Crypt::decryptString($record -> treatment) }}

Prescription

-

{{ $record -> prescription }}

+

{{ \Illuminate\Support\Facades\Crypt::decryptString($record -> prescription) }}

Notes

-

{{ $record -> notes }}

+

{{ \Illuminate\Support\Facades\Crypt::decryptString($record -> notes) }}