first commit
This commit is contained in:
30
app/Http/Resources/SI/SttMedicalHistoryResource.php
Normal file
30
app/Http/Resources/SI/SttMedicalHistoryResource.php
Normal file
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Resources\SI;
|
||||
|
||||
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 [
|
||||
'fullname' => $this->getFullNameAttribute(),
|
||||
'mpostdate' => Carbon::parse($this->mpostdate)->format('d.m.Y'),
|
||||
'menddate' => Carbon::parse($this->menddate)->format('d.m.Y'),
|
||||
'narhiv' => $this->narhiv,
|
||||
'datearhiv' => Carbon::parse($this->datearhiv)->format('d.m.Y'),
|
||||
'statgod' => $this->statgod,
|
||||
'enp' => $this->enp,
|
||||
'nkarta' => $this->nkarta,
|
||||
'dr' => Carbon::parse($this->dr)->format('d.m.Y'),
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user