Fix Empty String to Null

This commit is contained in:
2022-07-27 14:20:18 +07:00
parent 8b7b0b92a8
commit 51e7567b91
2 changed files with 14 additions and 9 deletions

View File

@@ -134,7 +134,7 @@ class Benefit extends Model
public function setPrePostTreatmentAttribute($value)
{
return empty($value) ? null : ($value == 'Y');
$this->attributes['pre_post_treatment'] = empty($value) ? null : ($value == 'Y');
}
public function getPrePostTreatmentAttribute($value)

View File

@@ -114,29 +114,34 @@ class Plan extends Model
"Max Periode of Surgery Non Surgery" => "max_surgery_periode_days",
];
public function setAreaLimitAttribute($value)
{
$this->attributes['area_limit'] = empty($value) ? null : $value;
}
public function setStartAttribute($value)
{
return empty($valu) ? null : $value;
$this->attributes['start'] = empty($value) ? null : $value;
}
public function setEndAttribute($value)
{
return empty($valu) ? null : $value;
$this->attributes['end'] = empty($value) ? null : $value;
}
public function setMaxClaimCount($value)
public function setMaxClaimCountAttribute($value)
{
return empty($value) ? null : $value;
$this->attributes['max_claim_count'] = empty($value) ? null : $value;
}
public function setMaxSurgeryReinstatementDays($value)
public function setMaxSurgeryReinstatementDaysAttribute($value)
{
return empty($value) ? null : $value;
$this->attributes['max_surgery_reinstatement_days'] = empty($value) ? null : $value;
}
public function setMaxSurgeryPeriodeDays($value)
public function setMaxSurgeryPeriodeDaysAttribute($value)
{
return empty($value) ? null : $value;
$this->attributes['max_surgery_periode_days'] = empty($value) ? null : $value;
}
public function scopeFilter($query, array $filters)