Fixes for API and live map

This commit is contained in:
Nabeel Shahzad
2018-05-02 15:14:18 -05:00
parent 9183e0b2aa
commit 5dff563c75
18 changed files with 1971 additions and 377 deletions

View File

@@ -43,6 +43,7 @@ use PhpUnitsOfMeasure\Exception\NonStringUnitName;
* @property Carbon created_at
* @property Carbon updated_at
* @property bool state
* @property Acars position
* @package App\Models
*/
class Pirep extends Model
@@ -177,6 +178,19 @@ class Pirep extends Model
return null;
}
/**
* Return the block on time
* @return Carbon
*/
public function getSubmittedAtAttribute()
{
if (array_key_exists('submitted_at', $this->attributes)) {
return new Carbon($this->attributes['submitted_at']);
}
return null;
}
/**
* Return a new Length unit so conversions can be made
* @return int|Distance