Add historic airports to database
This commit is contained in:
@@ -20,12 +20,14 @@ class Airport extends Model
|
||||
'icao_code',
|
||||
'iata_code',
|
||||
'local_code',
|
||||
'active',
|
||||
];
|
||||
|
||||
protected $casts = [
|
||||
'latitude_deg' => 'float',
|
||||
'longitude_deg' => 'float',
|
||||
'elevation_ft' => 'integer',
|
||||
'active' => 'boolean',
|
||||
];
|
||||
|
||||
protected $appends = [
|
||||
@@ -37,6 +39,8 @@ class Airport extends Model
|
||||
'LHR', 'LGW', 'STN', 'LTN', 'LCY', 'SEN',
|
||||
];
|
||||
|
||||
|
||||
|
||||
protected function displayName() : Attribute{
|
||||
return Attribute::make(
|
||||
get: function () {
|
||||
@@ -53,6 +57,11 @@ class Airport extends Model
|
||||
);
|
||||
}
|
||||
|
||||
public function scopeActive($query)
|
||||
{
|
||||
return $query->where('active', true);
|
||||
}
|
||||
|
||||
public function region(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(Region::class);
|
||||
|
||||
Reference in New Issue
Block a user