⚝
One Hat Cyber Team
⚝
Your IP:
216.73.216.19
Server IP:
178.33.27.10
Server:
Linux cpanel.dev-unit.com 3.10.0-1160.108.1.el7.x86_64 #1 SMP Thu Jan 25 16:17:31 UTC 2024 x86_64
Server Software:
Apache/2.4.57 (Unix) OpenSSL/1.0.2k-fips
PHP Version:
8.2.11
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
home
/
id
/
hospital.dev-unit.com
/
app
/
Repositories
/
View File Name :
VaccinatedPatientRepository.php
<?php namespace App\Repositories; use App\Models\Patient; use App\Models\VaccinatedPatients; use App\Models\Vaccination; use Illuminate\Support\Facades\Auth; /** * Class VaccinatedPatientRepository * * @version March 31, 2020, 12:22 pm UTC */ class VaccinatedPatientRepository extends BaseRepository { /** * @var array */ protected $fieldSearchable = [ 'patient_id', 'vaccination_id', 'vaccination_serial_number', 'dose_type', 'dose_given_date', ]; /** * Return searchable fields */ public function getFieldsSearchable(): array { return $this->fieldSearchable; } /** * Configure the Model **/ public function model() { return VaccinatedPatients::class; } public function getVaccinatedPatientData(): array { $data = null; $user = Auth::user(); if ($user->hasRole('Doctor')) { $data['patients'] = getPatientsList($user->owner_id); } else { // $data['patients'] = Patient::with('user')->whereHas('user', function (Builder $query) { // $query->where('status', 1); // })->get()->pluck('user.full_name', 'id'); $data['patients'] = Patient::getActivePatientNames(); } $data['vaccinations'] = Vaccination::toBase()->pluck('name', 'id')->toArray(); natcasesort($data['vaccinations']); return $data; } }