fix serialization of converter classes #189

This commit is contained in:
Nabeel Shahzad
2018-02-10 22:30:42 -06:00
parent 9b9a20b437
commit 0700c96901
4 changed files with 10 additions and 14 deletions

View File

@@ -155,9 +155,9 @@ class Pirep extends BaseModel
public function setPlannedDistanceAttribute($value)
{
if ($value instanceof Distance) {
$this->attributes['distance'] = $value->toUnit(Distance::STORAGE_UNIT);
$this->attributes['planned_distance'] = $value->toUnit(Distance::STORAGE_UNIT);
} else {
$this->attributes['distance'] = $value;
$this->attributes['planned_distance'] = $value;
}
}