Added Notifications

This commit is contained in:
2026-05-16 23:48:18 +10:00
parent 69d72e0912
commit 1d5b9f340f
61 changed files with 4204 additions and 182 deletions
+1
View File
@@ -40,6 +40,7 @@ class Achievement extends Model
'achievement_difficulty_id',
'threshold',
'has_page',
'sort_order',
];
protected $casts = [
+23 -3
View File
@@ -26,9 +26,29 @@ class Aircraft extends Model
'display_name_short'
];
const array IATA_ALIAS_MAP = [
'7S8' => '73H',
'7S9' => '73J'
public const array BOEING_FAMILIES = [
'707' => ['B701', 'B703', 'B720'],
'717' => ['B712', 'B717'],
'727' => ['B721', 'B722', 'B727'],
'737' => ['B731', 'B732', 'B733', 'B734', 'B735', 'B736', 'B737', 'B738', 'B739', 'B37M', 'B38M', 'B39M'],
'747' => ['B741', 'B742', 'B743', 'B744', 'B748', 'B74D', 'B74R', 'B74S'],
'757' => ['B752', 'B753', 'B757'],
'767' => ['B762', 'B763', 'B764', 'B767'],
'777' => ['B772', 'B773', 'B77L', 'B77W', 'B778', 'B779'],
'787' => ['B788', 'B789', 'B78X'],
];
public const array AIRBUS_FAMILIES = [
'A300' => ['A30B', 'A300', 'A306'],
'A310' => ['A310', 'A312', 'A313'],
'A318' => ['A318'],
'A319' => ['A319', 'A31X'],
'A320' => ['A320', 'A20N'],
'A321' => ['A321', 'A21N'],
'A330' => ['A330', 'A332', 'A333', 'A338', 'A339'],
'A340' => ['A340', 'A342', 'A343', 'A345', 'A346'],
'A350' => ['A350', 'A358', 'A359', 'A35K'],
'A380' => ['A380', 'A388'],
];
protected function displayName() : Attribute{
+8
View File
@@ -55,6 +55,14 @@ class User extends Authenticatable
return $this->hasMany(UserFlight::class);
}
public function departedFlights() : HasMany {
return $this->flights()->where('departure_date', '<=', now('UTC'));
}
public function upcomingFlights() : HasMany {
return $this->flights()->where('departure_date', '>=', now('UTC'));
}
public function ImportedFlights(): HasMany
{
return $this->hasMany(ImportedFlight::class);