finally fixed serialization of conversions #189

This commit is contained in:
Nabeel Shahzad
2018-02-10 22:49:08 -06:00
parent 0700c96901
commit d5c2d25c74
6 changed files with 16 additions and 7 deletions

View File

@@ -12,7 +12,7 @@ class Flight extends Resource
$flight = parent::toArray($request);
// Return multiple measures so the client can pick what they want
if(filled($this->distance) && $this->distance instanceof Distance) {
if($this->distance instanceof Distance) {
$flight['distance'] = $this->distance->toObject();
}

View File

@@ -17,11 +17,11 @@ class Pirep extends Resource
{
$pirep = parent::toArray($request);
if (filled($this->distance) && $this->distance instanceof Distance) {
if ($this->distance instanceof Distance) {
$pirep['distance'] = $this->distance->toObject();
}
if (filled($this->planned_distance) && $this->planned_distance instanceof Distance) {
if ($this->planned_distance instanceof Distance) {
$pirep['planned_distance'] = $this->planned_distance->toObject();
}