23 lines
436 B
PHP
23 lines
436 B
PHP
<?php
|
|
|
|
namespace App\Presenters;
|
|
|
|
use Carbon\Carbon;
|
|
use CultureGr\Presenter\Presenter;
|
|
|
|
class StudyPresenter extends Presenter
|
|
{
|
|
public function toArray(): array
|
|
{
|
|
return $this->model->toArray();
|
|
}
|
|
|
|
public function sexAge(): array
|
|
{
|
|
$dob = $this->model->patient_birthdate;
|
|
$age = $dob ? Carbon::make($dob)->diffInYears() : null;
|
|
|
|
return "$age / {$this->model->patient_sex}";
|
|
}
|
|
}
|