'float', 'longitude_deg' => 'float', 'elevation_ft' => 'integer', ]; protected $appends = [ 'display_code', 'display_name', ]; protected function displayName() : Attribute{ return Attribute::make( get: function () { $codes = array_filter([$this->iata_code, $this->icao_code]); $codeString = count($codes) ? ' (' . implode('/', $codes) . ')' : ''; return "{$this->municipality} / {$this->name}{$codeString}"; } ); } protected function displayCode(): Attribute { return Attribute::make( get: fn () => $this->iata_code ?? $this->icao_code ?? $this->local_code ?? '---' ); } public function region(): BelongsTo { return $this->belongsTo(Region::class); } }