Add historic airports to database

This commit is contained in:
2026-08-22 14:13:37 +10:00
parent 3c66a3945c
commit 4a9b1ad56a
5 changed files with 181 additions and 13 deletions
+9
View File
@@ -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);