Много всего
This commit is contained in:
31
app/Http/Resources/Mis/SttMedicalHistoryResource.php
Normal file
31
app/Http/Resources/Mis/SttMedicalHistoryResource.php
Normal file
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Resources\Mis;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Http\Resources\Json\JsonResource;
|
||||
use Illuminate\Support\Carbon;
|
||||
|
||||
class SttMedicalHistoryResource extends JsonResource
|
||||
{
|
||||
/**
|
||||
* Transform the resource into an array.
|
||||
*
|
||||
* @return array<string, mixed>
|
||||
*/
|
||||
public function toArray(Request $request): array
|
||||
{
|
||||
return [
|
||||
'id' => $this->MedicalHistoryID,
|
||||
'fullname' => $this->getFullNameAttribute(),
|
||||
'daterecipient' => Carbon::parse($this->DateRecipient)->format('d.m.Y'),
|
||||
'dateextract' => Carbon::parse($this->DateExtract)->format('d.m.Y'),
|
||||
'card_num' => $this->archiveInfo->num ?? null,
|
||||
'status' => $this->archiveInfo->status ?? null,
|
||||
'datearhiv' => $this->archiveInfo?->post_at ? Carbon::parse($this->archiveInfo->post_at)->format('d.m.Y') : null,
|
||||
'medcardnum' => $this->MedCardNum,
|
||||
'dr' => Carbon::parse($this->BD)->format('d.m.Y'),
|
||||
'can_be_issue' => $this->canBeIssued()
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user