Adds setter to model Asset class for expected checkin

This commit is contained in:
Ivan Nieto Vivanco 2023-02-19 12:31:10 -06:00
parent fdffe76b9f
commit 6e994c209f

View file

@ -186,6 +186,14 @@ class Asset extends Depreciable
'model.manufacturer' => ['name'],
];
// To properly set the expected checkin as Y-m-d
public function setExpectedCheckinAttribute($value)
{
if ($value == '') {
$value = null;
}
$this->attributes['expected_checkin'] = $value;
}
/**
* This handles the custom field validation for assets