Update Aircraft Model (Landing Time Attribute) (#1336)
* Update Aircraft.php Return `landing_time` attribute in Carbon format if it is not empty * StyleFix
This commit is contained in:
parent
91d68308aa
commit
930d4cfa08
@ -100,6 +100,18 @@ class Aircraft extends Model
|
||||
$this->attributes['icao'] = strtoupper($icao);
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the landing time in carbon format if provided
|
||||
*
|
||||
* @return Carbon|null
|
||||
*/
|
||||
public function getLandingTimeAttribute()
|
||||
{
|
||||
if (array_key_exists('landing_time', $this->attributes) && filled($this->attributes['landing_time'])) {
|
||||
return new Carbon($this->attributes['landing_time']);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* foreign keys
|
||||
*/
|
||||
|
Loading…
Reference in New Issue
Block a user