Updated Map View
This commit is contained in:
@@ -48,6 +48,9 @@ class UserFlight extends Model
|
||||
'duration_display',
|
||||
'distance',
|
||||
'livery_url',
|
||||
'scope',
|
||||
'range',
|
||||
'region_range'
|
||||
];
|
||||
|
||||
public function calculateGreatCircleDistance(): float{
|
||||
@@ -108,6 +111,26 @@ class UserFlight extends Model
|
||||
);
|
||||
}
|
||||
|
||||
protected function scope(): Attribute
|
||||
{
|
||||
return Attribute::make(
|
||||
get: fn() => $this->departureAirport->region->country_id == $this->arrivalAirport->region->country_id ? 'domestic' : 'international'
|
||||
);
|
||||
}
|
||||
protected function range(): Attribute
|
||||
{
|
||||
return Attribute::make(
|
||||
get: fn() => $this->departureAirport->region->continent_id == $this->arrivalAirport->region->continent_id ? 'intracontinental' : 'intercontinental'
|
||||
);
|
||||
}
|
||||
|
||||
protected function regionRange(): Attribute
|
||||
{
|
||||
return Attribute::make(
|
||||
get: fn() => $this->departureAirport->region_id == $this->arrivalAirport->region_id ? 'intraregional' : 'interregional'
|
||||
);
|
||||
}
|
||||
|
||||
protected function arrivalDayDifference(): Attribute
|
||||
{
|
||||
return Attribute::make(
|
||||
|
||||
Reference in New Issue
Block a user