From 571768b39d714511bfe014591bd5bdeaf25b7997 Mon Sep 17 00:00:00 2001 From: "B.Fatih KOZ" Date: Tue, 2 Nov 2021 16:23:52 +0300 Subject: [PATCH] Match Flight and Pirep ident attributes (#1342) * Flight ident change * Pirep ident change * Update Pirep.php --- app/Models/Flight.php | 6 +++--- app/Models/Pirep.php | 12 +++++------- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/app/Models/Flight.php b/app/Models/Flight.php index 621f1079..d81fcd92 100644 --- a/app/Models/Flight.php +++ b/app/Models/Flight.php @@ -136,7 +136,7 @@ class Flight extends Model } /** - * Get the flight ident, e.,g JBU1900 + * Get the flight ident, e.,g JBU1900/C.nn/L.yy */ public function getIdentAttribute(): string { @@ -144,11 +144,11 @@ class Flight extends Model $flight_id .= $this->flight_number; if (filled($this->route_code)) { - $flight_id .= '-'.$this->route_code; + $flight_id .= '/C.'.$this->route_code; } if (filled($this->route_leg)) { - $flight_id .= '-'.$this->route_leg; + $flight_id .= '/L.'.$this->route_leg; } return $flight_id; diff --git a/app/Models/Pirep.php b/app/Models/Pirep.php index 4a953e6c..c5050551 100644 --- a/app/Models/Pirep.php +++ b/app/Models/Pirep.php @@ -215,21 +215,19 @@ class Pirep extends Model } /** - * Get the flight ident, e.,g JBU1900 - * - * @return string + * Get the flight ident, e.,g JBU1900/C.nn/L.yy */ public function getIdentAttribute(): string { - //$flight_id = $this->airline->code; - $flight_id = $this->flight_number; + $flight_id = $this->airline->code; + $flight_id .= $this->flight_number; if (filled($this->route_code)) { - $flight_id .= '/C'.$this->route_code; + $flight_id .= '/C.'.$this->route_code; } if (filled($this->route_leg)) { - $flight_id .= '/L'.$this->route_leg; + $flight_id .= '/L.'.$this->route_leg; } return $flight_id;