update ecard dan daily monitoring

This commit is contained in:
2023-12-28 15:50:56 +07:00
parent 10f702f2f0
commit 19e9e334e2
18 changed files with 1146 additions and 133 deletions

View File

@@ -255,19 +255,46 @@ class Member extends Model
);
}
protected function birthDate(): Attribute
// protected function birthDate(): Attribute
// {
// // $date = $this->person->birth_date ?? ($this->birth_date ?? null);
// $date = $this->birth_date ?? ($this->person->birth_date ?? null);
// return Attribute::make(
// get: fn () => !empty($date) ? Carbon::parse($date)->format('Y-m-d') : null
// );
// }
protected function birthDateeCard(): Attribute
{
// $date = $this->person->birth_date ?? ($this->birth_date ?? null);
$date = $this->person->birth_date ?? ($this->birth_date ?? null);
$date = $this->birth_date ?? ($this->birth_date ?? this->person->birth_date);
return Attribute::make(
get: fn () => !empty($date) ? Carbon::parse($date)->format('Y-m-d') : null
get: fn () => !empty($date) ? Carbon::parse($date)->format('d / M / Y') : null
);
}
protected function startDate(): Attribute
{
// $date = $this->person->birth_date ?? ($this->birth_date ?? null);
$date = $this->members_effective_date;
return Attribute::make(
get: fn () => !empty($date) ? Carbon::parse($date)->format('d / M / Y') : null
);
}
protected function endDate(): Attribute
{
// $date = $this->person->birth_date ?? ($this->birth_date ?? null);
$date = $this->members_expire_date;
return Attribute::make(
get: fn () => !empty($date) ? Carbon::parse($date)->format('d / M / Y') : null
);
}
protected function gender(): Attribute
{
return Attribute::make(
get: fn () => $this->person->gender ?? null
get: fn () => ucfirst($this->person->gender) ?? null
);
}