Compare commits

...

39 Commits

Author SHA1 Message Date
dredgy 7e3af37a46 Added achievement data 2026-04-29 18:22:49 +10:00
dredgy b94b1d8ec2 Added achievement data 2026-04-28 22:16:21 +10:00
dredgy 14aed7bf6e Added achievement data 2026-04-26 20:00:11 +10:00
dredgy f6d5b97784 Added achievement data 2026-04-26 15:16:17 +10:00
dredgy 1821b99524 Updated logo API 2026-04-26 12:45:01 +10:00
dredgy f8bac7f85a Updated logo API 2026-04-25 23:57:29 +10:00
dredgy 924e03334c Updated logo API 2026-04-25 23:49:08 +10:00
dredgy de183995b6 Updated logo API 2026-04-25 22:57:18 +10:00
dredgy 678096b463 Updated logo API 2026-04-23 21:32:25 +10:00
dredgy 110ed5b984 Updated logo API 2026-04-23 00:53:19 +10:00
dredgy bd8ef98d30 Added User API 2026-04-22 15:17:01 +10:00
dredgy d68e23e93a Added Crew and General Aviation Filters 2026-04-21 00:28:54 +10:00
dredgy 9e995eedef Added Crew and General Aviation Filters 2026-04-20 23:02:03 +10:00
dredgy a57775e141 Added Crew and General Aviation Filters 2026-04-20 22:30:34 +10:00
dredgy e007824fa9 Add more airlines and fix edit bugs 2026-04-20 16:42:11 +10:00
dredgy 061ee9dd07 Add more airlines and fix edit bugs 2026-04-20 13:48:15 +10:00
dredgy 5deefcbfb3 Add more airlines and fix edit bugs 2026-04-20 13:36:58 +10:00
dredgy 8d7d8f02d3 Add more airlines and fix edit bugs 2026-04-20 09:23:26 +10:00
dredgy 4244b8835d Add more airlines and fix edit bugs 2026-04-19 13:05:50 +10:00
dredgy d90f338321 Add more airlines and fix edit bugs 2026-04-18 16:45:13 +10:00
dredgy 63d6fb9e76 Add more airlines and fix edit bugs 2026-04-18 14:22:51 +10:00
dredgy 147bf43f09 Deduplicate airlines 2026-04-18 12:40:55 +10:00
dredgy 5066052013 Deduplicate airlines 2026-04-17 00:02:47 +10:00
dredgy a535521834 User can add/edit flights 2026-04-16 16:28:22 +10:00
dredgy 2a657bbbf7 User can add/edit flights 2026-04-14 20:52:38 +10:00
dredgy 4110b52ba5 User can add/edit flights 2026-04-14 20:06:33 +10:00
dredgy a9aa65f0d2 User can add/edit flights 2026-04-12 20:34:22 +10:00
dredgy 0f84ec023e Added Charts 2026-04-11 23:11:22 +10:00
dredgy f335951784 Added Charts 2026-04-11 23:00:35 +10:00
dredgy 95624f345c Added Charts 2026-04-11 20:49:01 +10:00
dredgy e83fd3bdca Added Charts 2026-04-11 17:30:16 +10:00
dredgy 7a07616f03 Corrected Korea 2026-04-09 11:20:16 +10:00
dredgy 43f5c8ac3e Started a flight view 2026-04-07 21:31:36 +10:00
dredgy 79469c02cf Started a flight view 2026-04-07 18:11:12 +10:00
dredgy 2ad8c65b86 Started a flight view 2026-04-06 11:49:54 +10:00
dredgy b53c92de36 Started a flight view 2026-04-06 11:13:35 +10:00
dredgy 968272754e Save user flights 2026-04-06 10:39:03 +10:00
dredgy 8da717a400 Save user flights 2026-04-05 21:38:36 +10:00
dredgy fcbf021af7 Save user flights 2026-04-05 18:55:39 +10:00
189 changed files with 14575 additions and 173 deletions
@@ -0,0 +1,33 @@
<?php
namespace App\Http\Controllers;
use App\Models\Achievement;
use App\Models\User;
use Illuminate\Http\Request;
use Inertia\Inertia;
class AchievementController extends Controller
{
public function index(User $user)
{
$achievements = Achievement::with(['category', 'difficulty'])
->get()
->groupBy(fn(Achievement $a) => $a->category->name)
->map(fn($group) => $group->sortBy('id')->values());
$userAchievements = $user->achievements()
->with('achievement')
->orderBy('achievement_id')
->get()
->keyBy('achievement_id');
return Inertia::render('UserAchievements', [
'user' => $user,
'canEdit' => auth()->id() === $user->id,
'isFollowing' => auth()->check() && auth()->user()->isFollowing($user),
'achievements' => $achievements,
'userAchievements' => $userAchievements,
]);
}
}
@@ -0,0 +1,12 @@
<?php
namespace App\Http\Controllers;
use App\Models\Airline;
use Illuminate\Database\Migrations\Migration;
use Illuminate\Http\Request;
class AirlineController extends Controller
{
}
@@ -0,0 +1,76 @@
<?php
namespace App\Http\Controllers\Api;
use App\Http\Controllers\ApiController;
use App\Http\Controllers\Controller;
use App\Models\Airline;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Storage;
class AirlineApiController extends ApiController
{
const array CONDOR_LOGOS = ['BEACH', 'ISLAND', 'PASSION', 'SEA', 'SUNSHINE'];
public function getAirlineLogo(?Airline $airline)
{
$logoFile = $airline?->logo ?? 'blank.png';
$cacheLimit = 60 * 60 * 24;
if ($airline?->internal_name == 'condor') {
$logoKey = array_rand(self::CONDOR_LOGOS);
$logoFile = 'DE_' . self::CONDOR_LOGOS[$logoKey] . '.png';
$cacheLimit = 1;
}
$path = 'images/logos/tail/' . $logoFile;
if (!Storage::disk('local')->exists($path)) {
$path = 'images/logos/tail/blank.png';
}
$fullPath = Storage::disk('local')->path($path);
$lastModified = filemtime($fullPath);
return response()->file($fullPath, [
'Content-Type' => 'image/png',
'Cache-Control' => 'public, max-age='.$cacheLimit, // 24 hours
'Last-Modified' => gmdate('D, d M Y H:i:s', $lastModified) . ' GMT',
'ETag' => md5($path . $lastModified),
]);
}
public function getLogoByInternalName(string $internalName){
$airline = Airline::where('internal_name', $internalName)
->first();
return $this->getAirlineLogo($airline);
}
function parseAirlineData(Airline $airline){
$countryCode = $airline->country->code;
$result = $airline->toArray();
unset($result['id']);
unset($result['logo']);
unset($result['country_id']);
unset($result['country']);
$result['slug'] = $result['internal_name'];
unset($result['internal_name']);
$result['country_code'] = $countryCode;
return $result;
}
function getByCode(string $code){
$lookupColumn = strlen($code) === 3 ? 'ICAO_code' : 'IATA_code';
$airlines = Airline::where($lookupColumn, strtoupper($code))->get()->map(fn($airline) => $this->parseAirlineData($airline));
return response()->json($airlines);
}
function get(string $internalName){
$airline = Airline::where('internal_name', $internalName)->first();
return response()->json($this->parseAirlineData($airline));
}
}
@@ -0,0 +1,60 @@
<?php
namespace App\Http\Controllers\Api;
use App\Http\Controllers\ApiController;
use App\Models\User;
use App\Models\UserFlight;
use Carbon\Carbon;
use Illuminate\Http\JsonResponse;
class UserApiController extends ApiController
{
public function nextFlight(string $username): JsonResponse
{
$user = User::where('name', 'ilike', $username)->first();
if (!$user) {
return response()->json(['message' => 'User not found'], 404);
}
$flight = UserFlight::with(['departureAirport', 'arrivalAirport', 'airline', 'aircraft'])
->where('user_id', $user->id)
->where('departure_date', '>', now()->utc())
->orderBy('departure_date', 'asc')
->first();
if (!$flight) {
return response()->json(['message' => 'No upcoming flights found'], 404);
}
$departure = Carbon::parse($flight->departure_date)->setTimezone($flight->departureAirport->timezone);
$arrival = Carbon::parse($flight->arrival_date)->setTimezone($flight->arrivalAirport->timezone);
return response()->json([
'departureAirportCode' => $flight->departureAirport->iata_code,
'departureCity' => $flight->departureAirport->municipality,
'departureDateReadable' => $departure->format('F j'),
'departureTime' => $departure->format('H:i'),
'arrivalAirportCode' => $flight->arrivalAirport->iata_code,
'arrivalCity' => $flight->arrivalAirport->municipality,
'arrivalDateReadable' => $arrival->format('F j'),
'arrivalTime' => $arrival->format('H:i'),
'flightNumber' => $flight->flight_number,
'airlineName' => $flight->airline->name,
'aircraftType' => $flight->aircraft->manufacturer_code . ' ' . $flight->aircraft->model_full_name,
'logoUrl' => $flight->airline?->logo_url ?? 'undefined',
]);
}
public function flights(string $username): JsonResponse
{
$user = User::where('name', 'ilike', $username)->first();
if (!$user) {
return response()->json(['message' => 'User not found'], 404);
}
return response()->json($user->FlightController()->flights());
}
}
+10
View File
@@ -0,0 +1,10 @@
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
class ApiController extends Controller
{
}
@@ -8,7 +8,9 @@ use Illuminate\Auth\Events\Registered;
use Illuminate\Http\RedirectResponse; use Illuminate\Http\RedirectResponse;
use Illuminate\Http\Request; use Illuminate\Http\Request;
use Illuminate\Support\Facades\Auth; use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Hash; use Illuminate\Support\Facades\Hash;
use Illuminate\Support\Facades\Validator;
use Illuminate\Validation\Rules; use Illuminate\Validation\Rules;
use Illuminate\Validation\ValidationException; use Illuminate\Validation\ValidationException;
use Inertia\Inertia; use Inertia\Inertia;
@@ -31,12 +33,21 @@ class RegisteredUserController extends Controller
*/ */
public function store(Request $request): RedirectResponse public function store(Request $request): RedirectResponse
{ {
$request->validate([
'name' => 'required|string|max:255', $validator = Validator::make($request->all(), [
'name' => 'required|string|max:32|alpha_dash',
'email' => 'required|string|lowercase|email|max:255|unique:'.User::class, 'email' => 'required|string|lowercase|email|max:255|unique:'.User::class,
'password' => ['required', 'confirmed', Rules\Password::defaults()], 'password' => ['required', 'confirmed', Rules\Password::defaults()],
]); ]);
$validator->after(function ($validator) use ($request) {
if (User::whereRaw(DB::raw('LOWER(name) = ?'), [strtolower($request->name)])->exists()) {
$validator->errors()->add('name', 'The name has already been taken.');
}
});
$validator->validate();
$user = User::create([ $user = User::create([
'name' => $request->name, 'name' => $request->name,
'email' => $request->email, 'email' => $request->email,
+31
View File
@@ -0,0 +1,31 @@
<?php
namespace App\Http\Controllers;
use App\Models\UserAction;
use Illuminate\Http\Request;
use Inertia\Inertia;
class FeedController extends Controller
{
public function view()
{
$user = auth()->user();
$followeeIds = $user->following()->pluck('followee_id');
$feed = UserAction::whereIn('user_id', $followeeIds)
->whereNotIn('type', ['flight_deleted'])
->with([
'user',
])
->latest()
->limit(50)
->get();
return Inertia::render('Feed', [
'user' => $user,
'feed' => $feed,
]);
}
}
+277
View File
@@ -0,0 +1,277 @@
<?php
namespace App\Http\Controllers;
use App\Models\Aircraft;
use App\Models\Airline;
use App\Models\Airport;
use App\Models\CrewType;
use App\Models\FlightClass;
use App\Models\FlightReason;
use App\Models\SeatType;
use App\Models\UserAction;
use App\Models\UserFlight;
use Carbon\Carbon;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Auth;
use Inertia\Inertia;
use Illuminate\Foundation\Auth\Access\AuthorizesRequests;
class FlightController extends Controller
{
use AuthorizesRequests;
public function rules(): array
{
return [
'flight_number' => ['nullable', 'string', 'max:10'],
'departure_date' => ['required', 'date'],
'arrival_date' => ['required', 'date'],
'from_id' => ['required', 'integer', 'exists:airports,id'],
'to_id' => ['required', 'integer', 'exists:airports,id'],
'airline_id' => ['nullable', 'integer', 'exists:airlines,id'],
'aircraft_id' => ['nullable', 'integer', 'exists:aircraft,id'],
'aircraft_registration' => ['nullable', 'string', 'max:10'],
'seat_number' => ['nullable', 'string', 'max:10'],
'seat_type_id' => ['integer', 'exists:seat_types,id'],
'flight_class_id' => ['integer', 'exists:flight_classes,id'],
'flight_reason_id' => ['integer', 'exists:flight_reasons,id'],
'note' => ['nullable', 'string', 'max:5000'],
'auto_update' => ['boolean'],
'crew_type_id' => ['nullable', 'exists:crew_types,id'],
];
}
public function lookup(Request $request)
{
$number = strtoupper(trim($request->query('number', '')));
// Extract the airline code prefix — letters at the start e.g. "QF" from "QF1"
preg_match('/^([A-Z]{2,3})/', $number, $matches);
$code = $matches[1] ?? null;
$isIata = strlen($code) === 2;
$codeColumn = $isIata ? 'IATA_code' : 'ICAO_code';
$airlines = $code
? Airline::where($codeColumn, $code)
->get()
->map(fn ($airline) => ['value' => $airline->id, 'title' => $airline->display_name, 'logo_url' => $airline->logo_url])
->values()
->toArray()
: collect()->toArray();
return response()->json([
'airline_options' => $airlines,
'from_options' => [],
'to_options' => [],
'aircraft_options' => [],
]);
}
private function convertedDates(array $validated): array
{
$departureAirport = Airport::find($validated['from_id']);
$arrivalAirport = Airport::find($validated['to_id']);
return [
Carbon::createFromFormat('Y-m-d\TH:i', $validated['departure_date'], $departureAirport->timezone)->utc(),
Carbon::createFromFormat('Y-m-d\TH:i', $validated['arrival_date'], $arrivalAirport->timezone)->utc(),
];
}
private function recordChanges(UserFlight $flight, array $dirty, array $original, array $updated): void
{
$changes = [];
foreach ($dirty as $field => $newValue) {
$changes[] = $this->formatChange($field, $flight->getOriginal($field), $newValue);
}
UserAction::create([
'user_id' => $flight->user_id,
'data' => [
'changes' => $changes,
'original' => $original,
'updated' => $updated,
],
'type' => 'flight_updated',
]);
}
private array $labelCache = [];
private function resolveLabel(string $field, mixed $value): string
{
if (is_null($value)) {
return 'none';
}
$cacheKey = "{$field}:{$value}";
if (isset($this->labelCache[$cacheKey])) {
return $this->labelCache[$cacheKey];
}
$label = match($field) {
'airline_id' => Airline::find($value)?->display_name ?? $value,
'departure_airport_id',
'arrival_airport_id' => Airport::find($value)?->display_name ?? $value,
'aircraft_id' => Aircraft::find($value)?->display_name_short ?? $value,
'seat_type_id' => SeatType::find($value)?->name ?? $value,
'flight_class_id' => FlightClass::find($value)?->name ?? $value,
'flight_reason_id' => FlightReason::find($value)?->name ?? $value,
'crew_type_id' => CrewType::find($value)?->name ?? $value,
'departure_date',
'arrival_date' => Carbon::parse($value)->format('j F Y \a\t H:iA'),
default => (string) $value,
};
return $this->labelCache[$cacheKey] = $label;
}
private function formatChange(string $field, mixed $from, mixed $to): array
{
$label = str($field)->replace('_id', '')->replace('_', ' ')->title();
$fromLabel = $this->resolveLabel($field, $from);
$toLabel = $this->resolveLabel($field, $to);
return [
'field' => $field,
'from' => $fromLabel,
'to' => $toLabel,
];
}
private function flightPayload(array $validated): array
{
[$departureUtc, $arrivalUtc] = $this->convertedDates($validated);
return [
'departure_date' => $departureUtc,
'arrival_date' => $arrivalUtc,
'flight_number' => $validated['flight_number'],
'departure_airport_id' => $validated['from_id'],
'arrival_airport_id' => $validated['to_id'],
'airline_id' => $validated['airline_id'],
'aircraft_id' => $validated['aircraft_id'],
'aircraft_registration' => $validated['aircraft_registration'],
'seat_number' => $validated['seat_number'],
'seat_type_id' => $validated['seat_type_id'],
'flight_class_id' => $validated['flight_class_id'],
'flight_reason_id' => $validated['flight_reason_id'],
'note' => $validated['note'],
'auto_update' => $validated['auto_update'],
'crew_type_id' => $validated['crew_type_id'],
];
}
public function store(Request $request)
{
$validated = $request->validate($this->rules());
$newFlight = auth()->user()->flights()->create($this->flightPayload($validated));
UserAction::create([
'user_id' => $newFlight->user_id,
'type' => $newFlight->departure_date->isFuture() ? 'flight_booked' : 'flight_logged',
'data' => [
'flight' => $newFlight->snapshot($newFlight->id),
],
]);
return redirect()->route('profile.departure-board', [Auth::user()->name, $newFlight->id]);
}
public function update(Request $request, UserFlight $flight)
{
$this->authorize('update', $flight);
$validated = $request->validate($this->rules());
$flight->fill($this->flightPayload($validated));
if (!$flight->isDirty()) {
return redirect()->route('profile.departure-board', [Auth::user()->name, $flight->id]);
}
$dirty = $flight->getDirty();
$original = $flight->snapshot($flight->id);
$flight->save();
$updated = $flight->snapshot($flight->id);
$this->recordChanges($flight, $dirty, $original, $updated);
return redirect()->route('profile.departure-board', [Auth::user()->name, $flight->id]);
}
public function delete(UserFlight $flight)
{
$this->authorize('delete', $flight);
$snapshot = $this->flightSnapshot($flight->id);
if(now()->utc()->isBefore($flight->departure_date)){
$action = 'flight_deleted';
} else {
$action = 'flight_cancelled';
}
UserAction::create([
'user_id' => $flight->user_id,
'type' => $action,
'data' => [
'flight' => $snapshot,
]
]);
$flight->delete();
return redirect()->route('profile.departure-board', [Auth::user()->name]);
}
public function staticData() : array {
return [
'seat_types' => SeatType::orderBy('id')->get()->toArray(),
'flight_reasons' => FlightReason::orderBy('id')->get()->toArray(),
'flight_classes' => FlightClass::orderBy('id')->get()->toArray(),
'crew_types' => CrewType::orderBy('id')->get()->toArray(),
];
}
public function add(){
return Inertia::render('AddFlight', $this->staticData());
}
public function edit(UserFlight $flight)
{
$this->authorize('update', $flight);
$flight->load('airline', 'aircraft', 'departureAirport.region.country', 'arrivalAirport.region.country', 'seatType', 'flightClass', 'flightReason');
$flightData = [
'id' => $flight->id,
'flight_number' => $flight->flight_number,
'departure_date' => $flight->departure_date->setTimezone($flight->departureAirport->timezone)->format('Y-m-d\TH:i'),
'arrival_date' => $flight->arrival_date->setTimezone($flight->arrivalAirport->timezone)->format('Y-m-d\TH:i'),
'aircraft_registration' => $flight->aircraft_registration,
'seat_number' => $flight->seat_number,
'note' => $flight->note,
'auto_update' => $flight->auto_update,
'seat_type' => $flight->seatType->toArray(),
'flight_class' => $flight->flightClass->toArray(),
'crew_type' => $flight->crewType?->toArray() ?? [],
'flight_reason' => $flight->flightReason->toArray(),
'airline_options' => $flight->airline
? [['value' => $flight->airline->id, 'title' => $flight->airline->display_name, 'logo_url' => $flight->airline->logo_url]]
: [],
'from_options' => [['value' => $flight->departureAirport->id, 'title' => $flight->departureAirport->display_name, 'country_code' => strtolower($flight->departureAirport->region->country->code)]],
'to_options' => [['value' => $flight->arrivalAirport->id, 'title' => $flight->arrivalAirport->display_name, 'country_code' => strtolower($flight->arrivalAirport->region->country->code)]],
'aircraft_options' => $flight->aircraft
? [['value' => $flight->aircraft->id, 'title' => $flight->aircraft->display_name]]
: [],
];
return Inertia::render('AddFlight', [
'flight' => $flightData,
...$this->staticData(),
]);
}
}
+40 -15
View File
@@ -9,6 +9,7 @@ use App\Models\FlightClass;
use App\Models\FlightReason; use App\Models\FlightReason;
use App\Models\ImportedFlight; use App\Models\ImportedFlight;
use App\Models\SeatType; use App\Models\SeatType;
use App\Models\UserAction;
use App\Models\UserFlight; use App\Models\UserFlight;
use Carbon\Carbon; use Carbon\Carbon;
use Illuminate\Http\Request; use Illuminate\Http\Request;
@@ -38,20 +39,30 @@ class FlightImportController extends Controller
preg_match('/\((\w+)\)/', $aircraftQuery, $matches); preg_match('/\((\w+)\)/', $aircraftQuery, $matches);
$designator = $matches[1] ?? null; $designator = $matches[1] ?? null;
$sortOverrides = [
'B788' => "CASE WHEN model_full_name ILIKE '%BBJ%' THEN 1 ELSE 0 END",
'B789' => "CASE WHEN model_full_name ILIKE '%BBJ%' THEN 1 ELSE 0 END",
];
if(!$designator){ if(!$designator){
$aircraft = []; $aircraft = [];
} else { } else {
$aircraft = Aircraft::when($designator, fn($query) => $query->where('designator', 'ilike', $designator)) $aircraft = Aircraft::when($designator, fn($query) => $query->where('designator', 'ilike', $designator))
->when(
isset($sortOverrides[$designator]),
fn($q) => $q->orderByRaw($sortOverrides[$designator])
)
->orderBy('model_full_name') ->orderBy('model_full_name')
->limit(10) ->limit(10)
->get(['id', 'manufacturer_code', 'model_full_name', 'designator']) ->get(['id', 'manufacturer_code', 'model_full_name', 'designator'])
->map(fn($a) => [ ->map(fn($aircraft) => [
'value' => $a->id, 'value' => $aircraft->id,
'title' => "{$a->manufacturer_code} {$a->model_full_name} ({$a->designator})", 'title' => $aircraft->display_name,
]) ])
->values() ->values()
->toArray(); ->toArray();
} }
return $aircraft; return $aircraft;
@@ -80,11 +91,12 @@ class FlightImportController extends Controller
END END
", [$iata, $icao, $iata, $icao]) ", [$iata, $icao, $iata, $icao])
->limit(10) ->limit(10)
->orderBy('id')
->get(['id', 'name', 'municipality', 'iata_code', 'icao_code', 'region_id']) ->get(['id', 'name', 'municipality', 'iata_code', 'icao_code', 'region_id'])
->map(fn($a) => [ ->map(fn(Airport $airport) => [
'value' => $a->id, 'value' => $airport->id,
'title' => "{$a->municipality} / {$a->name} ({$a->iata_code}/{$a->icao_code})", 'title' => $airport->display_name,
'country_code' => strtolower($a?->region->country->code ?? ''), 'country_code' => strtolower($airport?->region->country->code ?? ''),
]) ])
->values() ->values()
->toArray(); ->toArray();
@@ -97,6 +109,10 @@ class FlightImportController extends Controller
$iata = $matches[1] ?? null; $iata = $matches[1] ?? null;
$icao = $matches[2] ?? null; $icao = $matches[2] ?? null;
if(!$iata && !$icao){
return [];
}
$airlines = Airline::when($iata || $icao, function ($query) use ($iata, $icao) { $airlines = Airline::when($iata || $icao, function ($query) use ($iata, $icao) {
$query->orderByRaw(" $query->orderByRaw("
CASE CASE
@@ -113,10 +129,11 @@ class FlightImportController extends Controller
}) })
->orderByDesc('active') ->orderByDesc('active')
->limit(10) ->limit(10)
->get(['id', 'name', 'IATA_code', 'ICAO_code']) ->get(['id', 'name', 'IATA_code', 'ICAO_code', 'internal_name'])
->map(fn($a) => [ ->map(fn($airline) => [
'value' => $a->id, 'value' => $airline->id,
'title' => "{$a->name} ({$a->IATA_code}/{$a->ICAO_code})", 'title' => $airline->display_name,
'logo_url' => $airline->logo_url,
]) ])
->values() ->values()
->toArray(); ->toArray();
@@ -179,9 +196,9 @@ class FlightImportController extends Controller
'aircraft_id' => 'nullable|integer|exists:aircraft,id', 'aircraft_id' => 'nullable|integer|exists:aircraft,id',
'registration' => 'nullable|string', 'registration' => 'nullable|string',
'seat_number' => 'nullable|string', 'seat_number' => 'nullable|string',
'seat_type_id' => 'nullable|integer|exists:seat_types,id', 'seat_type_id' => 'required|integer|exists:seat_types,id',
'flight_class_id' => 'nullable|integer|exists:flight_classes,id', 'flight_class_id' => 'required|integer|exists:flight_classes,id',
'flight_reason_id' => 'nullable|integer|exists:flight_reasons,id', 'flight_reason_id' => 'required|integer|exists:flight_reasons,id',
'note' => 'nullable|string', 'note' => 'nullable|string',
], [ ], [
'imported_flight_id.required' => 'The flight you are trying to reconcile needs to be reimported or refreshed.', 'imported_flight_id.required' => 'The flight you are trying to reconcile needs to be reimported or refreshed.',
@@ -228,7 +245,7 @@ class FlightImportController extends Controller
$arrival = $durationArrival; $arrival = $durationArrival;
} }
UserFlight::create([ $newFlight = UserFlight::create([
'user_id' => $user->id, 'user_id' => $user->id,
'departure_date' => $departure, 'departure_date' => $departure,
'arrival_date' => $arrival, 'arrival_date' => $arrival,
@@ -245,6 +262,14 @@ class FlightImportController extends Controller
'note' => $validated['note'] ?? null, 'note' => $validated['note'] ?? null,
]); ]);
UserAction::create([
'user_id' => $newFlight->user_id,
'type' => $newFlight->departure_date->isFuture() ? 'flight_booked' : 'flight_imported',
'data' => [
'flight' => $newFlight->snapshot($newFlight->id),
],
]);
ImportedFlight::destroy($validated['imported_flight_id']); ImportedFlight::destroy($validated['imported_flight_id']);
return to_route('reconcile'); return to_route('reconcile');
} }
@@ -0,0 +1,43 @@
<?php
namespace App\Http\Controllers;
use App\Models\User;
use App\Models\UserFlight;
use App\Http\Resources\UserFlightResource;
use Illuminate\Support\Facades\DB;
use Inertia\Inertia;
class FlightProfileController extends Controller
{
public function profileData(User $user, string $view, ?int $selectedFlightId = null) : array {
return [
'user' => $user,
'canEdit' => auth()->check() && auth()->id() === $user->id,
'initialView' => $view,
'selectedFlightId' => $selectedFlightId,
'flight_api_url' => '/data/user/'.$user->name.'/flights',
'isFollowing' => auth()->check() && auth()->user()->isFollowing($user),
];
}
public function departureBoard(User $user, ?UserFlight $flight = null){
$profileData = $this->profileData($user, 'board', $flight?->id);
return Inertia::render('UserProfile', $profileData);
}
public function map(User $user){
$profileData = $this->profileData($user, 'map');
return Inertia::render('UserProfile', $profileData);
}
public function boardingPasses(User $user){
$profileData = $this->profileData($user, 'passes');
return Inertia::render('UserProfile', $profileData);
}
public function view(User $user)
{
return $this->departureBoard($user);
}
}
+73 -33
View File
@@ -8,45 +8,85 @@ use Illuminate\Support\Facades\Storage;
class LogoController extends Controller class LogoController extends Controller
{ {
public function getAirlineLogo(?Airline $airline){
$logoFile = $airline?->logo ?? 'blank.png'; public static function deduplicateLogo(string $logo, array $correctInternalNames)
$path = 'images/logos/tail/' . $logoFile; {
if (!Storage::disk('local')->exists($path)) { $log = fn(string $message) => print($message . PHP_EOL);
$path = 'images/logos/tail/blank.png';
if (empty($correctInternalNames)) {
$nulled = Airline::where('logo', $logo)->get(['name', 'internal_name']);
Airline::where('logo', $logo)->update(['logo' => null]);
foreach ($nulled as $airline) {
$log(" Logo nulled: {$airline->name} ({$airline->internal_name})");
}
return;
} }
return response()->file(Storage::disk('local')->path($path), [ $existing = Airline::whereIn('internal_name', $correctInternalNames)
'Content-Type' => 'image/png', ->pluck('internal_name')
]); ->toArray();
}
public function getLogoById(int $id){ $missing = array_diff($correctInternalNames, $existing);
$airline = Airline::where('id', $id)
->first();
return $this->getAirlineLogo($airline); if (!empty($missing)) {
} throw new \InvalidArgumentException(
'The following internal names do not exist in the database: ' . implode(', ', $missing)
public function getLogoByCode(string $code){ );
$column = strlen($code) == 2
? 'IATA_code'
: 'ICAO_code';
$airline = Airline::where($column, strtoupper($code))
->whereNotNull('logo')
->where('active', true)
->latest('id')
->first();
if (!$airline) {
$airline = Airline::where($column, strtoupper($code))
->whereNotNull('logo')
->latest('id')
->first();
} }
return $this->getAirlineLogo($airline); $nulled = Airline::where('logo', $logo)
->whereNotIn('internal_name', $correctInternalNames)
->get(['name', 'internal_name']);
Airline::where('logo', $logo)
->whereNotIn('internal_name', $correctInternalNames)
->update(['logo' => null]);
foreach ($nulled as $airline) {
$log(" Logo nulled: {$airline->name} ({$airline->internal_name})");
}
}
public static function nullMissingLogoFiles()
{
$log = fn(string $message) => print($message . PHP_EOL);
$airlines = Airline::whereNotNull('logo')->get(['id', 'name', 'logo']);
foreach ($airlines as $airline) {
$path = storage_path('app/private/images/logos/tail/' . $airline->logo);
if (!file_exists($path)) {
$airline->update(['logo' => null]);
$log(" Logo nulled (file missing): {$airline->name}{$airline->logo}");
}
}
}
public static function renameLogoFiles()
{
$log = fn(string $message) => print($message . PHP_EOL);
$airlines = Airline::whereNotNull('logo')->get(['id', 'name', 'internal_name', 'logo']);
foreach ($airlines as $airline) {
$expectedName = $airline->internal_name . '.png';
if ($airline->logo === $expectedName) {
continue;
}
$oldPath = storage_path('app/private/images/logos/tail/' . $airline->logo);
$newPath = storage_path('app/private/images/logos/tail/' . $expectedName);
if (!file_exists($oldPath)) {
$log(" Skipping (file missing): {$airline->name}{$airline->logo}");
continue;
}
rename($oldPath, $newPath);
$airline->update(['logo' => $expectedName]);
$log(" Renamed: {$airline->logo}{$expectedName} ({$airline->name})");
}
} }
} }
@@ -0,0 +1,17 @@
<?php
namespace App\Http\Controllers;
use App\Models\Notification;
use Illuminate\Foundation\Auth\Access\AuthorizesRequests;
use Illuminate\Http\Request;
class NotificationController extends Controller
{
use AuthorizesRequests;
public function markRead(Request $request, Notification $notification)
{
$this->authorize('update', $notification);
$notification->markAsRead();
}
}
+25 -14
View File
@@ -14,15 +14,23 @@ class SearchController extends Controller
return Airline::orderByDesc('active') return Airline::orderByDesc('active')
->where(function ($query) use ($q) { ->where(function ($query) use ($q) {
$query->where('name', 'ilike', "%{$q}%") $len = strlen($q);
->orWhere('IATA_code', 'ilike', "%{$q}%") if ($len === 2) {
->orWhere('ICAO_code', 'ilike', "%{$q}%"); $query->where('IATA_code', 'ilike', $q);
} elseif ($len === 3) {
$query->where('ICAO_code', 'ilike', $q);
} else {
$query->where('name', 'ilike', "%{$q}%")
->orWhere('IATA_code', 'ilike', "%{$q}%")
->orWhere('ICAO_code', 'ilike', "%{$q}%");
}
}) })
->limit(50) ->limit(50)
->get(['id', 'name', 'IATA_code', 'ICAO_code', 'logo']) ->get()
->map(fn($a) => [ ->map(fn($airline) => [
'value' => $a->id, 'value' => $airline->id,
'title' => "{$a->name} ({$a->IATA_code}/{$a->ICAO_code})", 'title' => $airline->display_name,
'logo_url' => $airline->logo_url,
]) ])
->values(); ->values();
} }
@@ -30,14 +38,17 @@ class SearchController extends Controller
public function aircraft() public function aircraft()
{ {
$q = request('q', ''); $q = request('q', '');
$replacedQuery = str_replace(['A3', 'A2'], ['A-3', 'A-2'], $q);
return Aircraft::where('designator', 'ilike', "%{$q}%") return Aircraft::where('designator', 'ilike', "%{$q}%")
->orWhereRaw("CONCAT(manufacturer_code, ' ', model_full_name) ilike ?", ["%{$q}%"]) ->orWhereRaw("CONCAT(manufacturer_code, ' ', model_full_name) ilike ?", ["%{$q}%"])
->orWhereRaw("CONCAT(manufacturer_code, ' ', model_full_name) ilike ?", ["%{$replacedQuery}%"])
->limit(200) ->limit(200)
->orderBy('id', 'asc')
->get(['id', 'manufacturer_code', 'model_full_name', 'designator']) ->get(['id', 'manufacturer_code', 'model_full_name', 'designator'])
->map(fn($a) => [ ->map(fn($aircraft) => [
'value' => $a->id, 'value' => $aircraft->id,
'title' => "{$a->manufacturer_code} {$a->model_full_name} ({$a->designator})", 'title' => $aircraft->display_name,
]) ])
->values(); ->values();
} }
@@ -64,10 +75,10 @@ class SearchController extends Controller
", [$q, $q])) ", [$q, $q]))
->limit(15) ->limit(15)
->get(['id', 'name', 'municipality', 'iata_code', 'icao_code', 'region_id']) ->get(['id', 'name', 'municipality', 'iata_code', 'icao_code', 'region_id'])
->map(fn($a) => [ ->map(fn($airport) => [
'value' => $a->id, 'value' => $airport->id,
'title' => "{$a->municipality} / {$a->name} ({$a->iata_code}/{$a->icao_code})", 'title' => $airport->display_name,
'country_code' => strtolower($a->region->country->code), 'country_code' => strtolower($airport->region->country->code),
]) ])
->values(); ->values();
} }
+31
View File
@@ -0,0 +1,31 @@
<?php
namespace App\Http\Controllers;
use App\Models\Followee;
use App\Models\User;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\RedirectResponse;
use Illuminate\Http\Request;
class UserController extends Controller
{
public function follow(User $user): JsonResponse
{
$existing = Followee::where('user_id', auth()->id())
->where('followee_id', $user->id)
->first();
if ($existing) {
$existing->delete();
return response()->json(['following' => false]);
}
Followee::create([
'user_id' => auth()->id(),
'followee_id' => $user->id,
]);
return response()->json(['following' => true]);
}
}
@@ -0,0 +1,36 @@
<?php
namespace App\Http\Controllers;
use App\Models\User;
use App\Models\UserFlight;
use Illuminate\Http\Request;
class UserFlightController extends Controller
{
protected User $user;
function __construct(User $user){
$this->user = $user;
}
public function flights(){
return UserFlight::where('user_id', $this->user->id)
->with([
'departureAirport.region.country',
'departureAirport.region.continent',
'arrivalAirport.region.country',
'arrivalAirport.region.continent',
'airline.country',
'airline.alliance',
'aircraft',
'seatType',
'flightReason',
'flightClass',
'crewType'
])
->orderBy('departure_date', 'desc')
->get();
}
}
@@ -34,8 +34,16 @@ class HandleInertiaRequests extends Middleware
'logo_api_url' => config('app.logo_api_url'), 'logo_api_url' => config('app.logo_api_url'),
'auth' => [ 'auth' => [
'user' => $request->user(), 'user' => $request->user(),
'isLoggedIn' => $request->user() !== null,
], ],
'achievement_notifications' => fn() => $request->user()
? $request->user()
->notifications()
->with('achievement')
->where('is_achievement', true)
->whereNull('read_at')
->latest()
->get()
: [],
]; ];
} }
} }
+13
View File
@@ -0,0 +1,13 @@
<?php
namespace App\Http\Resources;
use App\Models\UserFlight;
use Carbon\Carbon;
use Illuminate\Http\Resources\Json\JsonResource;
/** @mixin UserFlight */
class UserFlightResource extends JsonResource
{
}
+74
View File
@@ -0,0 +1,74 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Collection;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\Relations\BelongsToMany;
use Illuminate\Database\Eloquent\Relations\HasMany;
/**
* @property int $id
* @property string $name
* @property string $internal_name
* @property string $short_description
* @property string $long_description
* @property string $icon
* @property bool $progressive
* @property string|null $difficulty_description
* @property int $achievement_category_id
* @property int $achievement_difficulty_id
*
* @property-read AchievementCategory $category
* @property-read AchievementDifficulty $difficulty
* @property-read Collection<int, UserAchievement> $userAchievements
* @property-read Collection<int, User> $users
*/
class Achievement extends Model
{
protected $fillable = [
'name',
'internal_name',
'short_description',
'long_description',
'icon',
'progressive',
'difficulty_description',
'achievement_category_id',
'achievement_difficulty_id',
'threshold',
];
protected $casts = [
'progressive' => 'boolean',
'threshold' => 'integer',
];
// ---------------------------------------------------------------
// Relationships
// ---------------------------------------------------------------
public function category(): BelongsTo
{
return $this->belongsTo(AchievementCategory::class, 'achievement_category_id');
}
public function difficulty(): BelongsTo
{
return $this->belongsTo(AchievementDifficulty::class, 'achievement_difficulty_id');
}
public function userAchievements(): HasMany
{
return $this->hasMany(UserAchievement::class, 'achievement_id');
}
/** Users who have unlocked (or are progressing toward) this achievement. */
public function users(): BelongsToMany
{
return $this->belongsToMany(User::class, 'user_achievements')
->withPivot('progress')
->withTimestamps();
}
}
+33
View File
@@ -0,0 +1,33 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Collection;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\HasMany;
/**
* @property int $id
* @property string $internal_name
* @property string $name
* @property string $description
*
* @property-read Collection<int, Achievement> $achievements
*/
class AchievementCategory extends Model
{
protected $fillable = [
'internal_name',
'name',
'description',
];
// ---------------------------------------------------------------
// Relationships
// ---------------------------------------------------------------
public function achievements(): HasMany
{
return $this->hasMany(Achievement::class, 'achievement_category_id');
}
}
+33
View File
@@ -0,0 +1,33 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Collection;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\HasMany;
/**
* @property int $id
* @property string $internal_name
* @property string $name
* @property string $description
*
* @property-read Collection<int, Achievement> $achievements
*/
class AchievementDifficulty extends Model
{
protected $fillable = [
'internal_name',
'name',
'description',
];
// ---------------------------------------------------------------
// Relationships
// ---------------------------------------------------------------
public function achievements(): HasMany
{
return $this->hasMany(Achievement::class, 'achievement_difficulty_id');
}
}
+24
View File
@@ -2,6 +2,7 @@
namespace App\Models; namespace App\Models;
use Illuminate\Database\Eloquent\Casts\Attribute;
use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\Model;
class Aircraft extends Model class Aircraft extends Model
@@ -19,4 +20,27 @@ class Aircraft extends Model
protected $casts = [ protected $casts = [
'engine_count' => 'integer', 'engine_count' => 'integer',
]; ];
protected $appends = [
'display_name',
'display_name_short'
];
protected function displayName() : Attribute{
return Attribute::make(
get: function () {
return "{$this->manufacturer_code} {$this->model_full_name} ({$this->designator})";
}
);
}
protected function displayNameShort(): Attribute
{
return Attribute::make(
get: function () {
$name = "{$this->manufacturer_code} {$this->model_full_name}";
return trim(preg_replace('/\s*\(.*?\)/', '', $name));
}
);
}
} }
+35 -1
View File
@@ -3,7 +3,9 @@
namespace App\Models; namespace App\Models;
use Illuminate\Database\Eloquent\Builder; use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Eloquent\Casts\Attribute;
use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
class Airline extends Model class Airline extends Model
{ {
@@ -15,6 +17,7 @@ class Airline extends Model
'name', 'name',
'internal_name', 'internal_name',
'country_id', 'country_id',
'alliance_id',
'active', 'active',
'logo', 'logo',
]; ];
@@ -23,6 +26,37 @@ class Airline extends Model
'active' => 'boolean', 'active' => 'boolean',
]; ];
public $timestamps = false; public $timestamps = false;
protected $appends = [
'display_name',
'logo_url',
];
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->name}{$codeString}";
}
);
}
protected function logoUrl() : Attribute{
return Attribute::make(
get: function () {
return config('app.logo_api_url') . "/airline/$this->internal_name/logo/tail";
}
);
}
public function alliance(): BelongsTo
{
return $this->belongsTo(Alliance::class);
}
public function country(): BelongsTo
{
return $this->belongsTo(Country::class);
}
} }
+22
View File
@@ -2,6 +2,7 @@
namespace App\Models; namespace App\Models;
use Illuminate\Database\Eloquent\Casts\Attribute;
use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo; use Illuminate\Database\Eloquent\Relations\BelongsTo;
@@ -27,6 +28,27 @@ class Airport extends Model
'elevation_ft' => 'integer', '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 public function region(): BelongsTo
{ {
return $this->belongsTo(Region::class); return $this->belongsTo(Region::class);
+25
View File
@@ -0,0 +1,25 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\HasMany;
class Alliance extends Model
{
protected $table = 'alliances';
protected $fillable = [
'internal_name',
'name',
];
protected $casts = [
'internal_name' => 'string',
];
public function airlines(): HasMany
{
return $this->hasMany(Airline::class);
}
}
+15
View File
@@ -0,0 +1,15 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
class CrewType extends Model
{
protected $table = 'crew_types';
protected $fillable = [
'name',
'internal_name',
];
}
+4 -1
View File
@@ -6,5 +6,8 @@ use Illuminate\Database\Eloquent\Model;
class FlightClass extends Model class FlightClass extends Model
{ {
// protected $fillable = [
'name',
'internal_name',
];
} }
+24
View File
@@ -0,0 +1,24 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
class Followee extends Model
{
protected $fillable = [
'user_id',
'followee_id',
];
public function user(): BelongsTo
{
return $this->belongsTo(User::class, 'user_id');
}
public function followee(): BelongsTo
{
return $this->belongsTo(User::class, 'followee_id');
}
}
+102
View File
@@ -0,0 +1,102 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
/**
* @property int $id
* @property int $user_id
* @property string $title
* @property string $body
* @property string|null $url
* @property bool $is_achievement
* @property int|null $achievement_id
* @property \Carbon\Carbon|null $read_at
* @property \Carbon\Carbon|null $dismissed_at
* @property \Carbon\Carbon|null $expires_at
*
* @property-read User $user
* @property-read Achievement|null $achievement
*
* @method static Builder unread()
* @method static Builder undismissed()
* @method static Builder active()
* @method static Builder forAchievements()
*/
class Notification extends Model
{
protected $fillable = [
'user_id',
'title',
'body',
'url',
'is_achievement',
'achievement_id',
'read_at',
'expires_at',
];
protected $casts = [
'is_achievement' => 'boolean',
'read_at' => 'datetime',
'expires_at' => 'datetime',
];
// ---------------------------------------------------------------
// Relationships
// ---------------------------------------------------------------
public function user(): BelongsTo
{
return $this->belongsTo(User::class);
}
public function achievement(): BelongsTo
{
return $this->belongsTo(Achievement::class);
}
// ---------------------------------------------------------------
// Scopes
// ---------------------------------------------------------------
/** Notifications the user hasn't opened yet. */
public function scopeUnread(Builder $query): void
{
$query->whereNull('read_at');
}
/** Not expired (no expiry set, or expiry is in the future). */
public function scopeActive(Builder $query): void
{
$query->where(function (Builder $q) {
$q->whereNull('expires_at')
->orWhere('expires_at', '>', now());
});
}
/** Only achievement notifications. */
public function scopeForAchievements(Builder $query): void
{
$query->where('is_achievement', true);
}
// ---------------------------------------------------------------
// Helpers
// ---------------------------------------------------------------
public function markAsRead(): void
{
if (! $this->read_at) {
$this->update(['read_at' => now()]);
}
}
public function isExpired(): bool
{
return $this->expires_at !== null && $this->expires_at->isPast();
}
}
+5
View File
@@ -19,4 +19,9 @@ class Region extends Model
{ {
return $this->belongsTo(Country::class); return $this->belongsTo(Country::class);
} }
public function continent(): BelongsTo
{
return $this->belongsTo(Continent::class);
}
} }
+3
View File
@@ -6,5 +6,8 @@ use Illuminate\Database\Eloquent\Model;
class SeatType extends Model class SeatType extends Model
{ {
protected $fillable = [
'name',
];
public $timestamps = false; public $timestamps = false;
} }
+47 -4
View File
@@ -2,22 +2,26 @@
namespace App\Models; namespace App\Models;
// use Illuminate\Contracts\Auth\MustVerifyEmail; use App\Http\Controllers\UserFlightController;
use Database\Factories\UserFactory; use Database\Factories\UserFactory;
use Illuminate\Database\Eloquent\Attributes\Fillable; use Illuminate\Database\Eloquent\Attributes\Fillable;
use Illuminate\Database\Eloquent\Attributes\Hidden; use Illuminate\Database\Eloquent\Attributes\Hidden;
use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\Relations\HasMany; use Illuminate\Database\Eloquent\Relations\HasMany;
use Illuminate\Foundation\Auth\User as Authenticatable; use Illuminate\Foundation\Auth\User as Authenticatable;
use Illuminate\Notifications\Notifiable; use App\Traits\HasAchievements;
use App\Models\Notification;
use Laravel\Sanctum\HasApiTokens;
#[Fillable(['name', 'email', 'password'])] #[Fillable(['name', 'email', 'password'])]
#[Hidden(['password', 'remember_token'])] #[Hidden(['password', 'remember_token'])]
class User extends Authenticatable class User extends Authenticatable
{ {
/** @use HasFactory<UserFactory> */ /** @use HasFactory<UserFactory> */
use HasFactory, Notifiable; use HasFactory, HasAchievements, HasApiTokens;
/** /**
* Get the attributes that should be cast. * Get the attributes that should be cast.
@@ -32,8 +36,47 @@ class User extends Authenticatable
]; ];
} }
public function achievements(): HasMany
{
return $this->hasMany(UserAchievement::class);
}
public function resolveRouteBinding($value, $field = null): ?User
{
return $this->where('name', 'ilike', $value)->firstOrFail();
}
public function FlightController(): UserFlightController
{
return new UserFlightController($this);
}
public function flights(): HasMany {
return $this->hasMany(UserFlight::class);
}
public function ImportedFlights(): HasMany public function ImportedFlights(): HasMany
{ {
return $this->hasMany(ImportedFlight::class); return $this->hasMany(ImportedFlight::class);
} }
public function following(): HasMany
{
return $this->hasMany(Followee::class, 'user_id');
}
public function followers(): HasMany
{
return $this->hasMany(Followee::class, 'followee_id');
}
public function isFollowing(User $user): bool
{
return $this->following()->where('followee_id', $user->id)->exists();
}
public function notifications(): HasMany
{
return $this->hasMany(Notification::class);
}
} }
+42
View File
@@ -0,0 +1,42 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
/**
* @property int $id
* @property int $user_id
* @property int $achievement_id
* @property int|null $progress
*
* @property-read User $user
* @property-read Achievement $achievement
*/
class UserAchievement extends Model
{
protected $fillable = [
'user_id',
'achievement_id',
'progress',
];
protected $casts = [
'progress' => 'integer',
];
// ---------------------------------------------------------------
// Relationships
// ---------------------------------------------------------------
public function user(): BelongsTo
{
return $this->belongsTo(User::class);
}
public function achievement(): BelongsTo
{
return $this->belongsTo(Achievement::class);
}
}
+47
View File
@@ -0,0 +1,47 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Casts\Attribute;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
class UserAction extends Model
{
protected $fillable = [
'user_id',
'type',
'data'
];
protected $casts = [
'user_id' => 'integer',
'data' => 'array',
];
protected $appends = [
'display_type',
];
protected function displayType(): Attribute
{
return Attribute::make(
get: fn () => match ($this->type) {
'flight_booked' => 'Flight Booked',
'flight_cancelled' => 'Flight Cancelled',
'flight_updated' => 'Flight Updated',
'flight_imported' => 'Flight Imported from FR24',
'flight_logged' => 'Flight Logged',
'flight_deleted' => 'Flight Deleted',
default => 'Unknown Action'
}
);
}
public function user(): BelongsTo
{
return $this->belongsTo(User::class, 'user_id');
}
}
+148
View File
@@ -2,6 +2,8 @@
namespace App\Models; namespace App\Models;
use Illuminate\Database\Eloquent\Casts\Attribute;
use Carbon\Carbon;
use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo; use Illuminate\Database\Eloquent\Relations\BelongsTo;
@@ -23,14 +25,154 @@ class UserFlight extends Model
'seat_type_id', 'seat_type_id',
'flight_class_id', 'flight_class_id',
'flight_reason_id', 'flight_reason_id',
'crew_type_id',
'note', 'note',
'auto_update',
]; ];
protected $casts = [ protected $casts = [
'departure_date' => 'immutable_datetime', 'departure_date' => 'immutable_datetime',
'arrival_date' => 'immutable_datetime', 'arrival_date' => 'immutable_datetime',
'auto_update' => 'boolean',
]; ];
protected $appends = [
'departure_date_display',
'departure_time_display',
'arrival_date_display',
'arrival_time_display',
'arrival_day_difference',
'duration',
'duration_display',
'distance',
];
public function calculateGreatCircleDistance(): float{
$earthRadiusKm = 6371;
[$depLat, $depLong] = [$this->departureAirport->latitude_deg, $this->departureAirport->longitude_deg];
[$arrLat, $arrLong] = [$this->arrivalAirport->latitude_deg, $this->arrivalAirport->longitude_deg];
$latDelta = deg2rad($arrLat - $depLat);
$longDelta = deg2rad($arrLong - $depLong);
$a = sin($latDelta / 2) * sin($latDelta / 2)
+ cos(deg2rad($depLat)) * cos(deg2rad($arrLat))
* sin($longDelta / 2) * sin($longDelta / 2);
$c = 2 * atan2(sqrt($a), sqrt(1 - $a));
return $earthRadiusKm * $c;
}
protected function departureDateDisplay(): Attribute
{
return Attribute::make(
get: fn() => $this->departure_date
->toMutable()
->setTimezone($this->departureAirport->timezone)
->format('j M Y')
);
}
protected function departureTimeDisplay(): Attribute
{
return Attribute::make(
get: fn() => $this->departure_date
->toMutable()
->setTimezone($this->departureAirport->timezone)
->format('g:iA')
);
}
protected function arrivalDateDisplay(): Attribute
{
return Attribute::make(
get: fn() => $this->arrival_date
?->copy()
->setTimezone($this->arrivalAirport->timezone)
->format('j M Y')
);
}
protected function arrivalTimeDisplay(): Attribute
{
return Attribute::make(
get: fn() => $this->arrival_date
?->copy()
->setTimezone($this->arrivalAirport->timezone)
->format('g:iA')
);
}
protected function arrivalDayDifference(): Attribute
{
return Attribute::make(
get: function () {
if (!$this->arrival_date) return 0;
$departureLocal = $this->departure_date->copy()->setTimezone($this->departureAirport->timezone);
$arrivalLocal = $this->arrival_date->copy()->setTimezone($this->arrivalAirport->timezone);
return (int) abs(
Carbon::parse($arrivalLocal->toDateString())
->diffInDays(Carbon::parse($departureLocal->toDateString()))
);
}
);
}
protected function duration(): Attribute
{
return Attribute::make(
get: fn() => $this->departure_date->diffInMinutes($this->arrival_date)
);
}
protected function durationDisplay(): Attribute
{
return Attribute::make(
get: function () {
$hours = intdiv($this->duration, 60);
$minutes = $this->duration % 60;
return $hours . 'h ' . str_pad($minutes, 2, '0', STR_PAD_LEFT) . 'm';
}
);
}
protected function distance(): Attribute
{
return Attribute::make(
get: fn() => $this->calculateGreatCircleDistance()
);
}
public function isDomestic() : bool{
return $this->departureAirport->region->country_id == $this->arrivalAirport->region->country_id;
}
public function isInternational() : bool{
return !$this->isDomestic();
}
public static function snapshot($userFlightId){
return UserFlight::with([
'departureAirport',
'departureAirport.region.country',
'arrivalAirport',
'arrivalAirport.region.country',
'aircraft',
'airline',
'airline.country',
'airline.alliance',
'flightClass',
'seatType',
'flightReason',
'crewType',
])->find($userFlightId)->toArray();
}
public function user(): BelongsTo public function user(): BelongsTo
{ {
return $this->belongsTo(User::class); return $this->belongsTo(User::class);
@@ -46,11 +188,17 @@ class UserFlight extends Model
return $this->belongsTo(Airport::class, 'arrival_airport_id'); return $this->belongsTo(Airport::class, 'arrival_airport_id');
} }
public function crewType(): BelongsTo
{
return $this->belongsTo(CrewType::class);
}
public function airline(): BelongsTo public function airline(): BelongsTo
{ {
return $this->belongsTo(Airline::class); return $this->belongsTo(Airline::class);
} }
public function aircraft(): BelongsTo public function aircraft(): BelongsTo
{ {
return $this->belongsTo(Aircraft::class); return $this->belongsTo(Aircraft::class);
+37
View File
@@ -0,0 +1,37 @@
<?php
namespace App\Observers;
use App\Models\Achievement;
use App\Models\Airline;
use App\Models\Alliance;
class AirlineObserver
{
public function created(Airline $airline): void
{
if ($airline->alliance_id !== null) {
$this->syncAllianceThresholds();
}
}
public function updated(Airline $airline): void
{
if ($airline->wasChanged('alliance_id')) {
$this->syncAllianceThresholds();
}
}
public function deleted(Airline $airline): void
{
$this->syncAllianceThresholds();
}
private function syncAllianceThresholds(): void
{
Alliance::withCount('airlines')->each(function (Alliance $alliance) {
Achievement::where('internal_name', "airlines_alliances.all_{$alliance->internal_name}")
->update(['threshold' => $alliance->airlines_count]);
});
}
}
+35
View File
@@ -0,0 +1,35 @@
<?php
namespace App\Observers;
use App\Models\UserFlight;
class FlightObserver
{
/**
* Recalculate after a flight is created.
*/
public function created(UserFlight $flight): void
{
$flight->user->calculateAchievements();
}
/**
* Recalculate after a flight is updated.
* Cabin class, flight type, airline, etc. may have changed,
* which could unlock or revoke achievements.
*/
public function updated(UserFlight $flight): void
{
$flight->user->calculateAchievements();
}
/**
* Recalculate after a flight is deleted.
* Previously earned achievements may no longer be valid.
*/
public function deleted(UserFlight $flight): void
{
$flight->user->calculateAchievements();
}
}
+66
View File
@@ -0,0 +1,66 @@
<?php
namespace App\Policies;
use App\Models\Notification;
use App\Models\User;
use Illuminate\Auth\Access\Response;
class NotificationPolicy
{
/**
* Determine whether the user can view any models.
*/
public function viewAny(User $user): bool
{
return false;
}
/**
* Determine whether the user can view the model.
*/
public function view(User $user, Notification $notification): bool
{
return false;
}
/**
* Determine whether the user can create models.
*/
public function create(User $user): bool
{
return false;
}
/**
* Determine whether the user can update the model.
*/
public function update(User $user, Notification $notification): bool
{
return $user->id === $notification->user_id;
}
/**
* Determine whether the user can delete the model.
*/
public function delete(User $user, Notification $notification): bool
{
return false;
}
/**
* Determine whether the user can restore the model.
*/
public function restore(User $user, Notification $notification): bool
{
return false;
}
/**
* Determine whether the user can permanently delete the model.
*/
public function forceDelete(User $user, Notification $notification): bool
{
return false;
}
}
+66
View File
@@ -0,0 +1,66 @@
<?php
namespace App\Policies;
use App\Models\User;
use App\Models\UserFlight;
use Illuminate\Auth\Access\Response;
class UserFlightPolicy
{
/**
* Determine whether the user can view any models.
*/
public function viewAny(User $user): bool
{
return false;
}
/**
* Determine whether the user can view the model.
*/
public function view(User $user, UserFlight $userFlight): bool
{
return false;
}
/**
* Determine whether the user can create models.
*/
public function create(User $user): bool
{
return false;
}
/**
* Determine whether the user can update the model.
*/
public function update(User $user, UserFlight $userFlight): bool
{
return $user->id === $userFlight->user_id;
}
/**
* Determine whether the user can delete the model.
*/
public function delete(User $user, UserFlight $userFlight): bool
{
return $user->id === $userFlight->user_id;
}
/**
* Determine whether the user can restore the model.
*/
public function restore(User $user, UserFlight $userFlight): bool
{
return false;
}
/**
* Determine whether the user can permanently delete the model.
*/
public function forceDelete(User $user, UserFlight $userFlight): bool
{
return false;
}
}
+6
View File
@@ -2,6 +2,10 @@
namespace App\Providers; namespace App\Providers;
use App\Models\Airline;
use App\Models\UserFlight;
use App\Observers\AirlineObserver;
use App\Observers\FlightObserver;
use Illuminate\Support\Facades\Vite; use Illuminate\Support\Facades\Vite;
use Illuminate\Support\ServiceProvider; use Illuminate\Support\ServiceProvider;
@@ -21,5 +25,7 @@ class AppServiceProvider extends ServiceProvider
public function boot(): void public function boot(): void
{ {
Vite::prefetch(concurrency: 3); Vite::prefetch(concurrency: 3);
UserFlight::observe(FlightObserver::class);
Airline::observe(AirlineObserver::class);
} }
} }
@@ -0,0 +1,163 @@
<?php
namespace App\Services\Achievements;
use App\Models\Achievement;
use App\Models\Notification;
use App\Models\User;
use App\Models\UserAchievement;
use App\Models\UserFlight;
use App\Services\Achievements\Checkers\AchievementCheckerInterface;
use App\Services\Achievements\Checkers\AircraftChecker;
use App\Services\Achievements\Checkers\CountriesAndContinentsChecker;
use App\Services\Achievements\Checkers\AirlinesAndAlliancesChecker;
use App\Services\Achievements\Checkers\FunChallengesChecker;
use App\Services\Achievements\Checkers\GeneralFlyingChecker;
use Illuminate\Support\Collection;
class AchievementService
{
/** Cached achievement lookups so checkers don't each hit the DB. */
private Collection $achievementCache;
/** The user currently being evaluated — set per calculate() call. */
private User $user;
private array $checkers = [
GeneralFlyingChecker::class,
CountriesAndContinentsChecker::class,
AircraftChecker::class,
AirlinesAndAlliancesChecker::class,
FunChallengesChecker::class,
];
public function __construct()
{
$this->achievementCache = collect();
}
// ---------------------------------------------------------------
// Orchestration
// ---------------------------------------------------------------
/**
* @var Collection<int,UserFlight> $flights
*/
private Collection $flights;
public function calculate(User $user): void
{
$this->user = $user;
$this->achievementCache = Achievement::all()->keyBy('internal_name');
// Load once with every relationship any checker could need
$this->flights = $user->flights()->with([
'airline.alliance',
'aircraft',
'flightClass',
'departureAirport.region',
'arrivalAirport.region',
'departureAirport.region.continent',
'arrivalAirport.region.continent',
])->get();
foreach ($this->checkers as $checkerClass) {
$checker = new $checkerClass($this);
$checker->check($user);
}
}
/**
* @return Collection<int,UserFlight>
*/
public function getFlights(): Collection
{
return $this->flights;
}
// ---------------------------------------------------------------
// Award / revoke
// ---------------------------------------------------------------
/**
* Upsert a user_achievement row and fire a notification if this
* is a newly unlocked achievement.
*/
public function award(Achievement $achievement, User $user, ?int $progress = null): void
{
$existing = UserAchievement::where('user_id', $user->id)
->where('achievement_id', $achievement->id)
->first();
$alreadyUnlocked = $existing !== null;
UserAchievement::updateOrCreate(
['user_id' => $user->id, 'achievement_id' => $achievement->id],
['progress' => $progress],
);
if (! $alreadyUnlocked) {
$this->createAchievementNotification($user, $achievement);
}
}
/**
* Update progress on a progressive achievement without marking it
* as unlocked (i.e. progress exists but threshold not yet met).
* Creates the row if it doesn't exist yet.
*/
public function updateProgress(Achievement $achievement, User $user, int $progress): void
{
UserAchievement::updateOrCreate(
['user_id' => $user->id, 'achievement_id' => $achievement->id],
['progress' => $progress],
);
}
/**
* Remove a user_achievement row and its associated notification
* if the achievement is no longer valid for this user.
*/
public function revoke(Achievement $achievement, User $user): void
{
UserAchievement::where('user_id', $user->id)
->where('achievement_id', $achievement->id)
->delete();
Notification::where('user_id', $user->id)
->where('achievement_id', $achievement->id)
->delete();
}
// ---------------------------------------------------------------
// Helpers for checkers
// ---------------------------------------------------------------
public function resolveAchievement(string $internalName): ?Achievement
{
$achievement = $this->achievementCache->get($internalName);
return $achievement instanceof Achievement ? $achievement : null;
}
public function currentUser(): User
{
return $this->user;
}
// ---------------------------------------------------------------
// Notifications
// ---------------------------------------------------------------
private function createAchievementNotification(User $user, Achievement $achievement): void
{
Notification::create([
'user_id' => $user->id,
'title' => $achievement->name,
'body' => $achievement->short_description,
'is_achievement' => true,
'achievement_id' => $achievement->id,
'expires_at' => null,
]);
}
}
@@ -0,0 +1,15 @@
<?php
namespace App\Services\Achievements\Checkers;
use App\Models\User;
interface AchievementCheckerInterface
{
/**
* Check all achievements in this category for the given user.
* Implementations should call $this->service->award() or $this->service->revoke()
* never touch user_achievements directly.
*/
public function check(): void;
}
@@ -0,0 +1,146 @@
<?php
namespace App\Services\Achievements\Checkers;
use App\Models\User;
use App\Models\UserFlight;
use Illuminate\Support\Collection;
class AircraftChecker extends BaseChecker
{
private 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'],
];
private 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'],
];
private const array DOUBLE_DECKER_DESIGNATORS = [
// A380
'A380', 'A388',
// 747 variants
'B741', 'B742', 'B743', 'B744', 'B748', 'B74D', 'B74R', 'B74S',
];
public function check(): void
{
/**
* @var $flights Collection<int, UserFlight>
*/
$flights = $this->flights();
$flightsWithAircraft = $flights->filter(fn($f) => $f->aircraft !== null);
$this->awardIf(
$flightsWithAircraft->contains(
fn(UserFlight $f) => in_array($f->aircraft->aircraft_description, ['LandPlane', 'SeaPlane'])
),
'aircraft.fly_on_a_plane'
);
$this->awardIf(
$flightsWithAircraft->contains(
fn(UserFlight $f) => $f->aircraft->aircraft_description === 'Helicopter'
),
'aircraft.fly_on_a_helicopter'
);
$this->awardIf(
$flightsWithAircraft->contains(
fn(UserFlight $f) => $f->aircraft->engine_type === 'Jet'
),
'aircraft.fly_on_a_jet'
);
$this->awardIf(
$flightsWithAircraft->contains(
fn(UserFlight $f) => $f->aircraft->engine_type === 'Turboprop/Turboshaft' || $f->aircraft->engine_type === 'Piston'
),
'aircraft.fly_on_a_prop'
);
// --- Engine count achievements ---
$this->awardIf(
$flightsWithAircraft->contains(fn(UserFlight $f) => $f->aircraft->engine_count === 1 && $f->aircraft->aircraft_description !== 'Helicopter'),
'aircraft.single_engine'
);
$this->awardIf(
$flightsWithAircraft->contains(fn(UserFlight $f) => $f->aircraft->engine_count === 2 && $f->aircraft->aircraft_description !== 'Helicopter'),
'aircraft.twin_engine'
);
$this->awardIf(
$flightsWithAircraft->contains(fn(UserFlight $f) => $f->aircraft->engine_count === 3 && $f->aircraft->aircraft_description !== 'Helicopter'),
'aircraft.tri_engine'
);
$this->awardIf(
$flightsWithAircraft->contains(fn(UserFlight $f) => $f->aircraft->engine_count === 4 && $f->aircraft->aircraft_description !== 'Helicopter'),
'aircraft.quad_engine'
);
// --- Double decker ---
$this->awardIf(
$flightsWithAircraft->contains(
fn(UserFlight $f) => in_array($f->aircraft->designator, self::DOUBLE_DECKER_DESIGNATORS)
),
'aircraft.double_decker'
);
// --- Smaller manufacturer (scheduled service only) ---
$this->awardIf(
$flightsWithAircraft->contains(
fn(UserFlight $f) => $f->airline && $f->flight_number && !in_array(strtolower($f->aircraft->manufacturer_code), ['boeing', 'airbus'])
),
'aircraft.smaller_manufacturer'
);
// --- Boeing 7x7 families ---
$flownBoeingFamilies = collect(self::BOEING_FAMILIES)
->filter(fn($designators) =>
$flightsWithAircraft->contains(
fn(UserFlight $f) => in_array($f->aircraft->designator, $designators)
)
)
->count();
$this->awardProgress($flownBoeingFamilies, 'aircraft.all_boeing_7x7');
// --- Airbus A3xx families ---
$flownAirbusFamilie = collect(self::AIRBUS_FAMILIES)
->filter(fn($designators) =>
$flightsWithAircraft->contains(
fn(UserFlight $f) => in_array($f->aircraft->designator, $designators)
)
)
->count();
$this->awardProgress($flownAirbusFamilie, 'aircraft.all_airbus_a3xx');
}
}
@@ -0,0 +1,45 @@
<?php
namespace App\Services\Achievements\Checkers;
use App\Models\Alliance;
use App\Models\User;
use App\Models\UserFlight;
use Illuminate\Support\Collection;
class AirlinesAndAlliancesChecker extends BaseChecker
{
const array US_3 = ['american-airlines', 'delta', 'united-airlines'];
const array ME_3 = ['emirates', 'etihad-airways', 'qatar-airways'];
const array CN_3 = ['china-southern-airlines', 'china-eastern', 'air-china'];
public function check(): void
{
$flights = $this->flights();
$alliances = Alliance::withCount('airlines')->pluck('id', 'internal_name');
$flownAllianceAirlines = $flights
->filter(fn(UserFlight $f) => $f->airline?->alliance !== null)
->groupBy(fn(UserFlight $f) => $f->airline->alliance->internal_name)
->map(fn($group) => $group->pluck('airline.internal_name')->unique()->count());
$check = fn(string $alliance): int => $flownAllianceAirlines->get($alliance, 0);
$this->awardProgress($check('skyteam'), 'airlines_alliances.all_skyteam');
$this->awardProgress($check('oneworld'), 'airlines_alliances.all_oneworld');
$this->awardProgress($check('star_alliance'), 'airlines_alliances.all_star_alliance');
$this->awardProgress($check('vanilla_alliance'), 'airlines_alliances.all_vanilla_alliance');
$flownAirlines = $flights
->pluck('airline.internal_name')
->filter()
->unique();
$checkGroup = fn(array $group): int => $flownAirlines->intersect($group)->count();
$this->awardProgress($checkGroup(self::ME_3), 'airlines_alliances.me3');
$this->awardProgress($checkGroup(self::US_3), 'airlines_alliances.us3');
$this->awardProgress($checkGroup(self::CN_3), 'airlines_alliances.cn3');
}
}
@@ -0,0 +1,70 @@
<?php
namespace App\Services\Achievements\Checkers;
use App\Models\Achievement;
use App\Services\Achievements\AchievementService;
use Illuminate\Support\Collection;
abstract class BaseChecker implements AchievementCheckerInterface
{
public function __construct(protected AchievementService $service) {}
protected function flights(): Collection
{
return $this->service->getFlights();
}
/**
* Resolve an achievement ID from its internal name.
* Results are cached on the service so repeated lookups are free.
*/
protected function achievement(string $internalName): ?Achievement
{
return $this->service->resolveAchievement($internalName);
}
/**
* Award a boolean (non-progressive) achievement if the condition is met,
* or revoke it if the condition is no longer met.
*/
protected function awardIf(bool $condition, string $internalName): void
{
$achievement = $this->achievement($internalName);
if (! $achievement) {
return;
}
if ($condition) {
$this->service->award($achievement, $this->currentUser());
} else {
$this->service->revoke($achievement, $this->currentUser());
}
}
/**
* Award a progressive achievement, updating progress and
* unlocking/revoking based on whether progress meets the threshold.
*/
protected function awardProgress(int $progress, string $internalName): void
{
$achievement = $this->achievement($internalName);
if (! $achievement) return;
if ($progress >= $achievement->threshold) {
$this->service->award($achievement, $this->currentUser(), $progress);
} else {
$this->service->updateProgress($achievement, $this->currentUser(), $progress);
}
}
/**
* The user currently being evaluated.
* Set by AchievementService before calling check().
*/
protected function currentUser(): \App\Models\User
{
return $this->service->currentUser();
}
}
@@ -0,0 +1,97 @@
<?php
namespace App\Services\Achievements\Checkers;
use App\Models\Continent;
use App\Models\User;
use App\Models\UserFlight;
use Illuminate\Support\Collection;
class CountriesAndContinentsChecker extends BaseChecker
{
private const INHABITED_CONTINENTS = [
'africa', 'asia', 'europe', 'north_america', 'oceania', 'south_america',
];
public function check(): void
{
$flights = $this->flights();
// Resolve internal_name → id once, used throughout
$continents = Continent::pluck('id', 'internal_name');
$arrivalContinentIds = $flights->pluck('arrivalAirport.region.continent_id')->unique();
$has = fn(string $name) => $arrivalContinentIds->contains($continents[$name]);
// --- Simple "fly to X continent" achievements ---
$this->awardIf(
$flights->contains(fn(UserFlight $f) =>
$f->departureAirport->region->continent_id !== $f->arrivalAirport->region->continent_id
),
'countries_continents.intercontinental'
);
$this->awardIf($has('africa'), 'countries_continents.fly_to_africa');
$this->awardIf($has('asia'), 'countries_continents.fly_to_asia');
$this->awardIf($has('oceania'), 'countries_continents.fly_to_oceania');
$this->awardIf($has('antarctica'), 'countries_continents.fly_to_antarctica');
$this->awardIf($has('europe'), 'countries_continents.fly_to_europe');
$this->awardIf($has('south_america'), 'countries_continents.fly_to_south_america');
$this->awardIf($has('north_america'), 'countries_continents.fly_to_north_america');
// --- All inhabited continents ---
$inhabitedIds = collect(self::INHABITED_CONTINENTS)->map(fn($name) => $continents[$name]);
$visitedInhabited = $arrivalContinentIds
->intersect($inhabitedIds)
->unique()
->count();
$this->awardProgress($visitedInhabited, 'countries_continents.all_inhabited_continents');
// --- All continents including Antarctica ---
$this->awardProgress(
$arrivalContinentIds->unique()->count(),
'countries_continents.all_continents'
);
// --- Continent route pairs ---
$this->checkContinentPairs($flights);
}
/**
* @param Collection<int, UserFlight> $flights
* @return void
*/
private function checkContinentPairs(Collection $flights): void
{
$oneWayRoutes = collect();
$directedRoutes = collect();
foreach ($flights as $flight) {
$dep = $flight->departureAirport->region->continent->internal_name;
$arr = $flight->arrivalAirport->region->continent->internal_name;
// Directed route key e.g. "europe→asia"
$directedRoutes->push("{$dep}{$arr}");
// Undirected — sort alphabetically so "europe→asia" and "asia→europe" are the same
$undirected = implode('→', collect([$dep, $arr])->sort()->values()->all());
$oneWayRoutes->push($undirected);
}
$this->awardProgress(
$oneWayRoutes->unique()->count(),
'countries_continents.all_continent_pairs_one_way'
);
$this->awardProgress(
$directedRoutes->unique()->count(),
'countries_continents.all_continent_pairs_both_ways'
);
}
}
@@ -0,0 +1,135 @@
<?php
namespace App\Services\Achievements\Checkers;
use App\Models\User;
use App\Models\UserFlight;
class FunChallengesChecker extends BaseChecker
{
const array US_STATES = [
'US-AK', 'US-AL', 'US-AR', 'US-AZ', 'US-CA', 'US-CO', 'US-CT', 'US-DC',
'US-DE', 'US-FL', 'US-GA', 'US-HI', 'US-IA', 'US-ID', 'US-IL', 'US-IN',
'US-KS', 'US-KY', 'US-LA', 'US-MA', 'US-MD', 'US-ME', 'US-MI', 'US-MN',
'US-MO', 'US-MS', 'US-MT', 'US-NC', 'US-ND', 'US-NE', 'US-NH', 'US-NJ',
'US-NM', 'US-NV', 'US-NY', 'US-OH', 'US-OK', 'US-OR', 'US-PA', 'US-RI',
'US-SC', 'US-SD', 'US-TN', 'US-TX', 'US-UT', 'US-VA', 'US-VT', 'US-WA',
'US-WI', 'US-WV', 'US-WY',
];
const array AUSTRALIAN_STATES = [
'AU-ACT', 'AU-NSW', 'AU-NT', 'AU-QLD', 'AU-SA', 'AU-TAS', 'AU-VIC', 'AU-WA',
];
const array CHINESE_PROVINCES = [
'CN-11', 'CN-12', 'CN-13', 'CN-14', 'CN-15', 'CN-21', 'CN-22', 'CN-23',
'CN-31', 'CN-32', 'CN-33', 'CN-34', 'CN-35', 'CN-36', 'CN-37', 'CN-41',
'CN-42', 'CN-43', 'CN-44', 'CN-45', 'CN-46', 'CN-50', 'CN-51', 'CN-52',
'CN-53', 'CN-54', 'CN-61', 'CN-62', 'CN-63', 'CN-64', 'CN-65',
];
const array BRAZILIAN_STATES = [
'BR-AC', 'BR-AL', 'BR-AM', 'BR-AP', 'BR-BA', 'BR-CE', 'BR-DF', 'BR-ES',
'BR-GO', 'BR-MA', 'BR-MG', 'BR-MS', 'BR-MT', 'BR-PA', 'BR-PB', 'BR-PE',
'BR-PI', 'BR-PR', 'BR-RJ', 'BR-RN', 'BR-RO', 'BR-RR', 'BR-RS', 'BR-SC',
'BR-SE', 'BR-SP', 'BR-TO',
];
const array CANADIAN_PROVINCES = [
'CA-AB', 'CA-BC', 'CA-MB', 'CA-NB', 'CA-NL', 'CA-NS', 'CA-NT',
'CA-NU', 'CA-ON', 'CA-PE', 'CA-QC', 'CA-SK', 'CA-YT',
];
public function check(): void
{
$flights = $this->flights();
$airlineLetters = $flights
->filter(fn(UserFlight $f) => $f->airline?->IATA_code !== null)
->map(fn(UserFlight $f) => strtoupper($f->airline->IATA_code[0]))
->filter(fn($letter) => ctype_alpha($letter))
->unique()
->count();
$this->awardProgress($airlineLetters, 'fun_challenges.airline_alphabet');
$airportLetters = $flights
->flatMap(fn(UserFlight $f) => [
$f->departureAirport?->iata_code,
$f->arrivalAirport?->iata_code,
])
->filter()
->map(fn($code) => strtoupper($code[0]))
->unique()
->count();
$this->awardProgress($airportLetters, 'fun_challenges.airport_alphabet');
// --- US States ---
$visitedUsStates = $flights
->flatMap(fn(UserFlight $f) => [
$f->departureAirport?->region?->code,
$f->arrivalAirport?->region?->code,
])
->filter()
->filter(fn($code) => in_array($code, self::US_STATES))
->unique()
->count();
$this->awardProgress($visitedUsStates, 'fun_challenges.us_states');
// --- Australian States ---
$visitedAustralianStates = $flights
->flatMap(fn(UserFlight $f) => [
$f->departureAirport?->region?->code,
$f->arrivalAirport?->region?->code,
])
->filter()
->filter(fn($code) => in_array($code, self::AUSTRALIAN_STATES))
->unique()
->count();
$this->awardProgress($visitedAustralianStates, 'fun_challenges.australian_states');
// --- Chinese Provinces ---
$visitedChineseProvinces = $flights
->flatMap(fn(UserFlight $f) => [
$f->departureAirport?->region?->code,
$f->arrivalAirport?->region?->code,
])
->filter()
->filter(fn($code) => in_array($code, self::CHINESE_PROVINCES))
->unique()
->count();
$this->awardProgress($visitedChineseProvinces, 'fun_challenges.chinese_provinces');
// --- Brazilian States ---
$visitedBrazilianStates = $flights
->flatMap(fn(UserFlight $f) => [
$f->departureAirport?->region?->code,
$f->arrivalAirport?->region?->code,
])
->filter()
->filter(fn($code) => in_array($code, self::BRAZILIAN_STATES))
->unique()
->count();
$this->awardProgress($visitedBrazilianStates, 'fun_challenges.brazilian_states');
// --- Canadian Provinces ---
$visitedCanadianProvinces = $flights
->flatMap(fn(UserFlight $f) => [
$f->departureAirport?->region?->code,
$f->arrivalAirport?->region?->code,
])
->filter()
->filter(fn($code) => in_array($code, self::CANADIAN_PROVINCES))
->unique()
->count();
$this->awardProgress($visitedCanadianProvinces, 'fun_challenges.canadian_provinces');
}
}
@@ -0,0 +1,79 @@
<?php
namespace App\Services\Achievements\Checkers;
use App\Models\User;
use App\Models\UserFlight;
use Illuminate\Database\Eloquent\Collection;
class GeneralFlyingChecker extends BaseChecker
{
public function check(): void
{
/**
* @var $flights Collection<int, UserFlight>
*/
$flights = $this->flights();
$count = $flights->count();
// --- Boolean achievements ---
$this->awardIf($count >= 1, 'general_flying.first_flight');
$this->awardIf(
$flights->contains(fn ($f) => $f->isDomestic()),
'general_flying.domestic_flight'
);
$this->awardIf(
$flights->contains(fn ($f) => $f->isInternational()),
'general_flying.international_flight'
);
$this->awardIf(
$flights->contains(fn ($f) => $f->flightClass->internal_name === 'business'),
'general_flying.business_class'
);
$this->awardIf(
$flights->contains(fn ($f) => $f->flightClass->internal_name === 'first'),
'general_flying.first_class'
);
$this->awardIf(
$flights->contains(fn ($f) => $f->flightClass->internal_name === 'premium_economy'),
'general_flying.premium_economy'
);
$this->awardIf(
$flights->contains(fn ($f) => in_array($f->flightClass->internal_name, ['business', 'first'])),
'general_flying.business_or_first'
);
$this->awardIf(
$flights->contains(fn ($f) => $f->flightClass->internal_name === 'private'),
'general_flying.fly_private'
);
$this->awardIf(
$flights->contains(fn ($f) => $f->flightClass->internal_name === 'general_aviation'),
'general_flying.general_aviation'
);
$this->awardIf(
$flights->filter(fn (UserFlight $f) => $f->isDomestic())
->map(fn (UserFlight $f) => $f->departureAirport->region->country_id)
->unique()
->count() >= 2,
'general_flying.domestic_two_countries'
);
// --- Progressive achievements ---
$this->awardProgress($count,'general_flying.10_flights');
$this->awardProgress($count,'general_flying.50_flights');
$this->awardProgress($count,'general_flying.100_flights');
$this->awardProgress($count,'general_flying.500_flights');
$this->awardProgress($count,'general_flying.1000_flights');
}
}
+18
View File
@@ -0,0 +1,18 @@
<?php
namespace App\Traits;
use App\Models\User;
use App\Services\Achievements\AchievementService;
/**
* @mixin User
*/
trait HasAchievements
{
public function calculateAchievements(): void
{
/** @var User $this */
app(AchievementService::class)->calculate($this);
}
}
+1
View File
@@ -7,6 +7,7 @@ use Illuminate\Foundation\Configuration\Middleware;
return Application::configure(basePath: dirname(__DIR__)) return Application::configure(basePath: dirname(__DIR__))
->withRouting( ->withRouting(
web: __DIR__.'/../routes/web.php', web: __DIR__.'/../routes/web.php',
api: __DIR__.'/../routes/api.php',
commands: __DIR__.'/../routes/console.php', commands: __DIR__.'/../routes/console.php',
health: '/up', health: '/up',
) )
+2 -2
View File
@@ -10,12 +10,12 @@
"license": "MIT", "license": "MIT",
"require": { "require": {
"php": "^8.4", "php": "^8.4",
"ext-pdo": "*",
"inertiajs/inertia-laravel": "^2.0", "inertiajs/inertia-laravel": "^2.0",
"laravel/framework": "^13.0", "laravel/framework": "^13.0",
"laravel/sanctum": "^4.0", "laravel/sanctum": "^4.0",
"laravel/tinker": "^3.0", "laravel/tinker": "^3.0",
"tightenco/ziggy": "^2.0", "tightenco/ziggy": "^2.0"
"ext-pdo": "*"
}, },
"require-dev": { "require-dev": {
"fakerphp/faker": "^1.23", "fakerphp/faker": "^1.23",
Generated
+3 -2
View File
@@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically" "This file is @generated automatically"
], ],
"content-hash": "1378206c681cc15470824af157a889be", "content-hash": "0e560320885031dd36bb08bb44fe05d4",
"packages": [ "packages": [
{ {
"name": "brick/math", "name": "brick/math",
@@ -9369,7 +9369,8 @@
"prefer-stable": true, "prefer-stable": true,
"prefer-lowest": false, "prefer-lowest": false,
"platform": { "platform": {
"php": "^8.3" "php": "^8.4",
"ext-pdo": "*"
}, },
"platform-dev": {}, "platform-dev": {},
"plugin-api-version": "2.9.0" "plugin-api-version": "2.9.0"
+84
View File
@@ -0,0 +1,84 @@
<?php
use Laravel\Sanctum\Sanctum;
return [
/*
|--------------------------------------------------------------------------
| Stateful Domains
|--------------------------------------------------------------------------
|
| Requests from the following domains / hosts will receive stateful API
| authentication cookies. Typically, these should include your local
| and production domains which access your API via a frontend SPA.
|
*/
'stateful' => explode(',', env('SANCTUM_STATEFUL_DOMAINS', sprintf(
'%s%s',
'localhost,localhost:3000,127.0.0.1,127.0.0.1:8000,::1',
Sanctum::currentApplicationUrlWithPort(),
// Sanctum::currentRequestHost(),
))),
/*
|--------------------------------------------------------------------------
| Sanctum Guards
|--------------------------------------------------------------------------
|
| This array contains the authentication guards that will be checked when
| Sanctum is trying to authenticate a request. If none of these guards
| are able to authenticate the request, Sanctum will use the bearer
| token that's present on an incoming request for authentication.
|
*/
'guard' => ['web'],
/*
|--------------------------------------------------------------------------
| Expiration Minutes
|--------------------------------------------------------------------------
|
| This value controls the number of minutes until an issued token will be
| considered expired. This will override any values set in the token's
| "expires_at" attribute, but first-party sessions are not affected.
|
*/
'expiration' => null,
/*
|--------------------------------------------------------------------------
| Token Prefix
|--------------------------------------------------------------------------
|
| Sanctum can prefix new tokens in order to take advantage of numerous
| security scanning initiatives maintained by open source platforms
| that notify developers if they commit tokens into repositories.
|
| See: https://docs.github.com/en/code-security/secret-scanning/about-secret-scanning
|
*/
'token_prefix' => env('SANCTUM_TOKEN_PREFIX', ''),
/*
|--------------------------------------------------------------------------
| Sanctum Middleware
|--------------------------------------------------------------------------
|
| When authenticating your first-party SPA with Sanctum you may need to
| customize some of the middleware Sanctum uses while processing the
| request. You may change the middleware listed below as required.
|
*/
'middleware' => [
'authenticate_session' => Laravel\Sanctum\Http\Middleware\AuthenticateSession::class,
'encrypt_cookies' => Illuminate\Cookie\Middleware\EncryptCookies::class,
'validate_csrf_token' => Illuminate\Foundation\Http\Middleware\ValidateCsrfToken::class,
],
];
@@ -0,0 +1,51 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
private array $timezones = [
176 => 'Antarctica/Macquarie',
1012 => 'America/Iqaluit',
1129 => 'America/Iqaluit',
1153 => 'America/Iqaluit',
9241 => 'Asia/Anadyr',
9245 => 'Asia/Anadyr',
9364 => 'Europe/Moscow',
9365 => 'Asia/Krasnoyarsk',
11018 => 'Asia/Ulaanbaatar',
11019 => 'Asia/Ulaanbaatar',
];
public function up(): void
{
// 1. Populate timezones for the specific airports that were missing them
foreach ($this->timezones as $id => $timezone) {
DB::table('airports')
->where('id', $id)
->whereNull('timezone')
->update(['timezone' => $timezone]);
}
// 2. Make the timezone column non-nullable
Schema::table('airports', function (Blueprint $table) {
$table->string('timezone')->nullable(false)->change();
});
}
public function down(): void
{
// 1. Revert the column back to nullable first
Schema::table('airports', function (Blueprint $table) {
$table->string('timezone')->nullable()->change();
});
// 2. Null out only the rows we populated
DB::table('airports')
->whereIn('id', array_keys($this->timezones))
->update(['timezone' => null]);
}
};
@@ -0,0 +1,113 @@
<?php
use App\Models\Airline;
use App\Models\Airport;
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Airport::where('iata_code', 'LZR')->update(['municipality' => 'Lizard Island']);
Airport::where('iata_code', 'SYD')->update(['municipality' => 'Sydney']);
Airport::where('iata_code', 'ISB')->update(['municipality' => 'Islamabad']);
Airport::where('iata_code', 'KUL')->update(['municipality' => 'Kuala Lumpur']);
Airport::where('iata_code', 'USM')->update(['municipality' => 'Ko Samui']);
Airport::where('iata_code', 'CDG')->update(['municipality' => 'Paris']);
Airport::where('iata_code', 'ORY')->update(['municipality' => 'Paris']);
Airport::where('iata_code', 'FRA')->update(['municipality' => 'Frankfurt']);
Airport::where('iata_code', 'EZE')->update(['municipality' => 'Buenos Aires']);
Airport::where('iata_code', 'PVG')->update(['municipality' => 'Shanghai']);
Airport::where('iata_code', 'MRU')->update(['municipality' => 'Mauritius']);
Airport::where('iata_code', 'HNL')->update(['municipality' => 'Honolulu']);
Airport::where('iata_code', 'NCL')->update(['municipality' => 'Newcastle upon Tyne']);
Airport::where('iata_code', 'KRK')->update(['municipality' => 'Krakow']);
Airport::where('iata_code', 'OTP')->update(['municipality' => 'Bucharest']);
Airport::where('iata_code', 'CAN')->update(['municipality' => 'Guangzhou']);
Airport::where('iata_code', 'XIY')->update(['municipality' => "Xi'an"]);
Airport::where('iata_code', 'ROR')->update(['municipality' => "Koror"]);
Airport::where('iata_code', 'WUH')->update(['municipality' => "Wuhan"]);
Airport::where('iata_code', 'CCS')->update(['municipality' => "Caracas"]);
Airport::where('iata_code', 'TFU')->update(['municipality' => "Chengdu"]);
Airport::where('iata_code', 'CTU')->update(['municipality' => "Chengdu"]);
Airport::where('iata_code', 'DMM')->update(['municipality' => "Dammam"]);
Airport::where('iata_code', 'VCE')->update(['municipality' => "Venice"]);
Airport::where('iata_code', 'MXP')->update(['municipality' => "Milan"]);
Airport::where('iata_code', 'DPS')->update(['municipality' => "Denpasar"]);
Airport::where('iata_code', 'CAY')->update(['municipality' => "Cayenne"]);
Airport::where('iata_code', 'LPA')->update(['municipality' => "Gran Canaria"]);
Airline::where('internal_name', 'thy-turkish-airlines')->update(['name' => 'Turkish Airlines']);
Airline::where('internal_name', 'air-china')->update(['name' => 'Air China']);
Airline::where('internal_name', 'jetstar-airways-pty')->update(['name' => 'Jetstar']);
Airline::where('internal_name', 'easyjet')->update(['name' => 'Easyjet']);
Airline::where('internal_name', 'china-west-air')->update(['name' => 'China West Air']);
Airline::where('internal_name', 'aeroenlaces-nacionales-s-a-de-c-v')->update(['name' => 'Viva']);
Airline::where('internal_name', 'aircompany-somon-air')->update(['name' => 'Somon Air']);
Airline::where('internal_name', 'hinterland-aviation-pty')->update(['name' => 'Hinterland Aviation']);
Airline::where('internal_name', 'mango-airlines-soc-trading-as-mango')->update(['name' => 'Mango']);
Airline::where('internal_name', 'air-manas-dba-air-manas-air')->update(['name' => 'Air Manas']);
Airline::where('internal_name', 'airasia-x-berhad-dba-airasia-x')->update(['name' => 'Air Asia X']);
Airline::where('internal_name', 'mesa-airlines')->update(['name' => 'Mesa Airlines']);
Airport::where('iata_code', 'MCT')->update(['municipality' => "Muscat"]);
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Airport::where('iata_code', 'LZR')->update(['municipality' => '']);
Airport::where('iata_code', 'SYD')->update(['municipality' => 'Sydney (Mascot)']);
Airport::where('iata_code', 'ISB')->update(['municipality' => 'Attock']);
Airport::where('iata_code', 'KUL')->update(['municipality' => 'Sepang']);
Airport::where('iata_code', 'USM')->update(['municipality' => 'Na Thon (Ko Samui Island)']);
Airport::where('iata_code', 'CDG')->update(['municipality' => "Paris (Roissy-en-France, Val-d'Oise)"]);
Airport::where('iata_code', 'ORY')->update(['municipality' => "Paris (Orly, Val-de-Marne)"]);
Airport::where('iata_code', 'FRA')->update(['municipality' => 'Frankfurt am Main']);
Airport::where('iata_code', 'EZE')->update(['municipality' => 'Buenos Aires (Ezeiza)']);
Airport::where('iata_code', 'PVG')->update(['municipality' => 'Shanghai (Pudong)']);
Airport::where('iata_code', 'MRU')->update(['municipality' => 'Plaine Magnien']);
Airport::where('iata_code', 'HNL')->update(['municipality' => 'Honolulu, Oahu']);
Airport::where('iata_code', 'NCL')->update(['municipality' => 'Newcastle upon Tyne, Tyne and Wear']);
Airport::where('iata_code', 'KRK')->update(['municipality' => 'Balice']);
Airport::where('iata_code', 'OTP')->update(['municipality' => 'Otopeni']);
Airport::where('iata_code', 'CAN')->update(['municipality' => 'Guangzhou (Huadu)']);
Airport::where('iata_code', 'XIY')->update(['municipality' => "Xianyang (Weicheng)"]);
Airport::where('iata_code', 'ROR')->update(['municipality' => "Babelthuap Island"]);
Airport::where('iata_code', 'WUH')->update(['municipality' => "Wuhan (Huangpi)"]);
Airport::where('iata_code', 'CCS')->update(['municipality' => "Maiquetía"]);
Airport::where('iata_code', 'TFU')->update(['municipality' => "Chengdu (Jianyang)"]);
Airport::where('iata_code', 'CTU')->update(['municipality' => "Chengdu (Shuangliu)"]);
Airport::where('iata_code', 'DMM')->update(['municipality' => "Ad Dammam"]);
Airport::where('iata_code', 'VCE')->update(['municipality' => "Venezia (VE)"]);
Airport::where('iata_code', 'MXP')->update(['municipality' => "Ferno (VA)"]);
Airport::where('iata_code', 'DPS')->update(['municipality' => "Kuta, Badung"]);
Airport::where('iata_code', 'CAY')->update(['municipality' => "Matoury"]);
Airport::where('iata_code', 'LPA')->update(['municipality' => "Gran Canaria Island"]);
Airport::where('iata_code', 'MCT')->update(['municipality' => "Muscat/Seeb"]);
Airline::where('internal_name', 'thy-turkish-airlines')->update(['name' => ' THY - Turkish Airlines']);
Airline::where('internal_name', 'air-china')->update(['name' => 'Air China Limited']);
Airline::where('internal_name', 'jetstar-airways-pty')->update(['name' => 'Jetstar Airways Pty Limited']);
Airline::where('internal_name', 'easyjet')->update(['name' => 'Easyjet Airline Company Limited']);
Airline::where('internal_name', 'china-west-air')->update(['name' => 'China West Air Co. Ltd.']);
Airline::where('internal_name', 'aeroenlaces-nacionales-s-a-de-c-v')->update(['name' => 'Aeroenlaces Nacionales S.A. De C.V.']);
Airline::where('internal_name', 'aircompany-somon-air')->update(['name' => 'Aircompany Somon Air LLC']);
Airline::where('internal_name', 'hinterland-aviation-pty')->update(['name' => 'Hinterland Aviation Pty Ltd']);
Airline::where('internal_name', 'mango-airlines-soc-trading-as-mango')->update(['name' => 'Mango Airlines (SOC) Ltd trading as MANGO']);
Airline::where('internal_name', 'air-manas-dba-air-manas-air')->update(['name' => 'Air Manas dba Air Manas ltd. Air Company']);
Airline::where('internal_name', 'airasia-x-berhad-dba-airasia-x')->update(['name' => 'Airasia X Berhad dba Airasia X']);
Airline::where('internal_name', 'mesa-airlines')->update(['name' => 'Mesa Airlines, Inc']);
}
};
@@ -0,0 +1,30 @@
<?php
use App\Models\Airline;
use App\Models\Country;
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
$northKorea = Country::where('code', 'KP')->first();
Airline::where('internal_name', 'air-koryo')->update(['country_id' => $northKorea->id]);
}
/**
* Reverse the migrations.
*/
public function down(): void
{
$southKorea = Country::where('code', 'KR')->first();
Airline::where('internal_name', 'air-koryo')->update(['country_id' => $southKorea->id]);
}
};
@@ -0,0 +1,22 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
public function up(): void
{
Schema::table('user_flights', function (Blueprint $table) {
$table->boolean('auto_update')->default(false)->after('note');
});
}
public function down(): void
{
Schema::table('user_flights', function (Blueprint $table) {
$table->dropColumn('auto_update');
});
}
};
@@ -0,0 +1,972 @@
<?php
use App\Http\Controllers\LogoController;
use App\Models\Airline;
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::table('airlines', function (Blueprint $table) {
$table->string('logo', 255)->nullable()->change();
});
LogoController::nullMissingLogoFiles();
$this->deDuplicateLogos();
$this->checkNonDuplicateLogos();
Airline::whereNull('logo')->delete();
}
private function checkNonDuplicateLogos(){
LogoController::deduplicateLogo('0V.png', ['vasco']);
LogoController::deduplicateLogo('2I.png', ['star-up']);
LogoController::deduplicateLogo('2H.png', []);
LogoController::deduplicateLogo('2J.png', ['air-burkina']);
LogoController::deduplicateLogo('2M.png', []);
LogoController::deduplicateLogo('2P.png', ['air-philippines-corporation-dba-pal-express-and-airphil-express']);
LogoController::deduplicateLogo('2R.png', []);
LogoController::deduplicateLogo('3F.png', []);
LogoController::deduplicateLogo('3H.png', ['air-inuit-ltd-ltee']);
LogoController::deduplicateLogo('3R.png', []);
LogoController::deduplicateLogo('3S.png', []);
LogoController::deduplicateLogo('3U.png', ['sichuan-airlines']);
LogoController::deduplicateLogo('4C.png', ['lan-colombia-airlines']);
LogoController::deduplicateLogo('4D.png', []);
LogoController::deduplicateLogo('4G.png', ['gazpromavia-aviation-ltd']);
LogoController::deduplicateLogo('4I.png', []);
LogoController::deduplicateLogo('4K.png', []);
LogoController::deduplicateLogo('4N.png', ['air-north-charter-and-training']);
LogoController::deduplicateLogo('4W.png', []);
LogoController::deduplicateLogo('4Z.png', ['airlink']);
LogoController::deduplicateLogo('5A.png', []);
LogoController::deduplicateLogo('5C.png', []);
LogoController::deduplicateLogo('5G.png', []);
LogoController::deduplicateLogo('5J.png', ['cebu-pacific-air']);
LogoController::deduplicateLogo('5K.png', []);
LogoController::deduplicateLogo('5M.png', []);
LogoController::deduplicateLogo('5N.png', []);
LogoController::deduplicateLogo('5U.png', ['transportes-aereos-guatemaltecos-s']);
LogoController::deduplicateLogo('5X.png', ['ups-airlines']);
LogoController::deduplicateLogo('6H.png', ['israir']);
LogoController::deduplicateLogo('6L.png', ['aklak']);
LogoController::deduplicateLogo('6O.png', []);
LogoController::deduplicateLogo('6W.png', []);
LogoController::deduplicateLogo('7J.png', ['ojsc-tajik-air']);
LogoController::deduplicateLogo('7R.png', ['joint-stock-aviation-rusline']);
LogoController::deduplicateLogo('8D.png', ['fitsair']);
LogoController::deduplicateLogo('8E.png', ['bering-air']);
LogoController::deduplicateLogo('8N.png', ['regional-air']);
LogoController::deduplicateLogo('8T.png', ['air-tindi-8t']);
LogoController::deduplicateLogo('8V.png', []);
LogoController::deduplicateLogo('8Z.png', []);
LogoController::deduplicateLogo('9C.png', []);
LogoController::deduplicateLogo('9M.png', []);
LogoController::deduplicateLogo('9Q.png', ['caicos-express-airways']);
LogoController::deduplicateLogo('A0.png', []);
LogoController::deduplicateLogo('A3.png', ['aegean-airlines']);
LogoController::deduplicateLogo('A4.png', []);
LogoController::deduplicateLogo('A5.png', ['hop']);
LogoController::deduplicateLogo('A6.png', []);
LogoController::deduplicateLogo('A8.png', []);
LogoController::deduplicateLogo('A9.png', ['georgian-airways']);
LogoController::deduplicateLogo('AA.png', ['american-airlines']);
LogoController::deduplicateLogo('AB.png', ['bonza']);
LogoController::deduplicateLogo('AC.png', ['air-canada']);
LogoController::deduplicateLogo('AF.png', ['air-france']);
LogoController::deduplicateLogo('AH.png', ['air-algerie']);
LogoController::deduplicateLogo('AI.png', ['air-india']);
LogoController::deduplicateLogo('AR.png', ['aerolineas-argentinas']);
LogoController::deduplicateLogo('AS.png', ['alaska-airlines']);
LogoController::deduplicateLogo('AT.png', ['royal-air-maroc']);
LogoController::deduplicateLogo('AV.png', ['avianca']);
LogoController::deduplicateLogo('AY.png', ['finnair']);
LogoController::deduplicateLogo('AZ.png', ['alitalia']);
LogoController::deduplicateLogo('B0.png', ['dreamjet-sas-t-a-la-compagnie']);
LogoController::deduplicateLogo('B2.png', ['belavia-belarusian-airlines']);
LogoController::deduplicateLogo('B4.png', []);
LogoController::deduplicateLogo('B9.png', ['iran-air-tours']);
LogoController::deduplicateLogo('BP.png', ['air-botswana']);
LogoController::deduplicateLogo('BW.png', ['caribbean-airlines']);
LogoController::deduplicateLogo('BY.png', []);
LogoController::deduplicateLogo('CI.png', ['china-airlines']);
LogoController::deduplicateLogo('CM_1.png', ['copa-airlines']);
LogoController::deduplicateLogo('CO_1.png', ['continental-airlines']);
LogoController::deduplicateLogo('CU.png', ['cubana']);
LogoController::deduplicateLogo('CX.png', ['cathay-pacific']);
LogoController::deduplicateLogo('CY.png', ['cyprus-airways']);
LogoController::deduplicateLogo('D0.png', ['dhl-air']);
LogoController::deduplicateLogo('D3.png', ['daallo-airlines']);
LogoController::deduplicateLogo('D4.png', []);
LogoController::deduplicateLogo('D6.png', []);
LogoController::deduplicateLogo('D8.png', ['norwegian-air-international']);
LogoController::deduplicateLogo('D9.png', []);
LogoController::deduplicateLogo('DE.png', ['condor']);
LogoController::deduplicateLogo('DJ_1.png', ['virgin-blue-airlines']);
LogoController::deduplicateLogo('DL.png', ['delta-air-lines']);
LogoController::deduplicateLogo('DT.png', ['taag-angola-airlines']);
LogoController::deduplicateLogo('EI.png', ['aer-lingus']);
LogoController::deduplicateLogo('ET.png', ['ethiopian-airlines']);
LogoController::deduplicateLogo('FG.png', ['ariana-afghan-airlines']);
LogoController::deduplicateLogo('FI.png', ['icelandair']);
LogoController::deduplicateLogo('FJ.png', ['air-pacific']);
LogoController::deduplicateLogo('G4.png', ['allegiant-air']);
LogoController::deduplicateLogo('G5.png', ['china-express-airlines']);
LogoController::deduplicateLogo('G9.png', ['air-arabia']);
LogoController::deduplicateLogo('GA.png', ['garuda']);
LogoController::deduplicateLogo('GL.png', ['air-greenland-a-s']);
LogoController::deduplicateLogo('GU.png', []);
LogoController::deduplicateLogo('H2.png', []);
LogoController::deduplicateLogo('HA.png', ['hawaiian-airlines']);
LogoController::deduplicateLogo('HF.png', ['air-cote-d-ivoire']);
LogoController::deduplicateLogo('I4.png', ['scott-air']);
LogoController::deduplicateLogo('I7.png', []);
LogoController::deduplicateLogo('I9.png', []);
LogoController::deduplicateLogo('IA.png', ['iraqi-airways']);
LogoController::deduplicateLogo('IB.png', ['iberia']);
LogoController::deduplicateLogo('IC.png', []);
LogoController::deduplicateLogo('IE.png', ['solomon-airlines']);
LogoController::deduplicateLogo('IG.png', []);
LogoController::deduplicateLogo('IR.png', ['iran-air']);
LogoController::deduplicateLogo('IY.png', ['yemenia']);
LogoController::deduplicateLogo('IZ.png', ['arkia-israeli-airlines']);
LogoController::deduplicateLogo('J0.png', []);
LogoController::deduplicateLogo('J2.png', ['azerbaijan-airlines']);
LogoController::deduplicateLogo('J3.png', ['northwestern-air-lease']);
LogoController::deduplicateLogo('J8.png', ['berjaya-air-sdn-bhd']);
LogoController::deduplicateLogo('JG_1.png', ['jetgo']);
LogoController::deduplicateLogo('JJ.png', ['tam-linhas-aereas']);
LogoController::deduplicateLogo('JL.png', ['japan-airlines']);
LogoController::deduplicateLogo('JV.png', ['bearskin-lake-air-lp']);
LogoController::deduplicateLogo('K2.png', []);
LogoController::deduplicateLogo('K3.png', []);
LogoController::deduplicateLogo('KE.png', ['korean-air']);
LogoController::deduplicateLogo('KL.png', ['klm']);
LogoController::deduplicateLogo('KM.png', ['air-malta']);
LogoController::deduplicateLogo('KU.png', ['kuwait-airways']);
LogoController::deduplicateLogo('KX.png', ['cayman-airways']);
LogoController::deduplicateLogo('L5.png', []);
LogoController::deduplicateLogo('LA.png', ['lan-airlines']);
LogoController::deduplicateLogo('LG.png', ['luxair']);
LogoController::deduplicateLogo('LO.png', ['lot-polish-airlines']);
LogoController::deduplicateLogo('LR.png', []);
LogoController::deduplicateLogo('LT.png', []);
LogoController::deduplicateLogo('LY.png', ['el-al-israel-airlines']);
LogoController::deduplicateLogo('M0.png', ['aero-mongolia']);
LogoController::deduplicateLogo('M3.png', []);
LogoController::deduplicateLogo('M5.png', ['kenmore-air']);
LogoController::deduplicateLogo('M9.png', ['motor-sich-jsc']);
LogoController::deduplicateLogo('ME.png', ['mea']);
LogoController::deduplicateLogo('MH.png', ['malaysia-airlines']);
LogoController::deduplicateLogo('MK.png', ['air-mauritius']);
LogoController::deduplicateLogo('MM.png', ['peach-aviation']);
LogoController::deduplicateLogo('MN.png', []);
LogoController::deduplicateLogo('MX.png', []);
LogoController::deduplicateLogo('NH.png', ['all-nippon-airways']);
LogoController::deduplicateLogo('O3.png', ['sf-airlines-limited']);
LogoController::deduplicateLogo('O4.png', []);
LogoController::deduplicateLogo('OA.png', ['olympic-air']);
LogoController::deduplicateLogo('OM.png', ['miat-mongolian-airlines']);
LogoController::deduplicateLogo('ON.png', ['nauru-air-corporation-t-a-our-airline']);
LogoController::deduplicateLogo('OO.png', ['skywest-airlines']);
LogoController::deduplicateLogo('OS.png', ['austrian']);
LogoController::deduplicateLogo('P0.png', ['proflight-zambia']);
LogoController::deduplicateLogo('P2.png', ['airkenya-express']);
LogoController::deduplicateLogo('P5.png', []);
LogoController::deduplicateLogo('P6.png', ['privilege-style-s-a']);
LogoController::deduplicateLogo('PH.png', []);
LogoController::deduplicateLogo('PK.png', ['pia']);
LogoController::deduplicateLogo('PR.png', ['philippine-airlines']);
LogoController::deduplicateLogo('PY.png', ['surinam-airways']);
LogoController::deduplicateLogo('PZ.png', []);
LogoController::deduplicateLogo('Q2.png', []);
LogoController::deduplicateLogo('QF.png', ['qantas']);
LogoController::deduplicateLogo('QI.png', []);
LogoController::deduplicateLogo('QM.png', ['monacair']);
LogoController::deduplicateLogo('R2.png', []);
LogoController::deduplicateLogo('R7.png', []);
LogoController::deduplicateLogo('RA.png', ['nepal-airlines-corporation']);
LogoController::deduplicateLogo('RB.png', ['syrianair']);
LogoController::deduplicateLogo('RJ.png', ['royal-jordanian']);
LogoController::deduplicateLogo('RO.png', ['tarom']);
LogoController::deduplicateLogo('RR.png', []);
LogoController::deduplicateLogo('S2.png', []);
LogoController::deduplicateLogo('S4.png', ['sata-internacional']);
LogoController::deduplicateLogo('S7.png', ['s7-airlines']);
LogoController::deduplicateLogo('SA.png', ['saa']);
LogoController::deduplicateLogo('SD.png', ['sudan-airways']);
LogoController::deduplicateLogo('SK.png', ['sas']);
LogoController::deduplicateLogo('SN.png', ['brussels-airlines']);
LogoController::deduplicateLogo('SU.png', ['aeroflot']);
LogoController::deduplicateLogo('SV.png', ['saudi-arabian-airlines']);
LogoController::deduplicateLogo('TG.png', ['thai-airways-international']);
LogoController::deduplicateLogo('TK.png', ['thy-turkish-airlines']);
LogoController::deduplicateLogo('TP.png', ['tap-portugal']);
LogoController::deduplicateLogo('TU.png', ['tunisair']);
LogoController::deduplicateLogo('TY.png', ['air-caledonie']);
LogoController::deduplicateLogo('U2.png', ['easyjet']);
LogoController::deduplicateLogo('U5.png', []);
LogoController::deduplicateLogo('U6.png', ['ural-airlines']);
LogoController::deduplicateLogo('UT.png', ['utair']);
LogoController::deduplicateLogo('UU.png', ['air-austral']);
LogoController::deduplicateLogo('V0.png', ['conviasa']);
LogoController::deduplicateLogo('V7.png', ['volotea']);
LogoController::deduplicateLogo('VA_2.png', ['v-australia']);
LogoController::deduplicateLogo('VO.png', []);
LogoController::deduplicateLogo('VR.png', ['tacv-cabo-verde-airlines']);
LogoController::deduplicateLogo('VT.png', ['air-tahiti']);
LogoController::deduplicateLogo('W5.png', ['mahan-air']);
LogoController::deduplicateLogo('WF.png', ['wideroe']);
LogoController::deduplicateLogo('WM.png', []);
LogoController::deduplicateLogo('WY.png', ['oman-air']);
LogoController::deduplicateLogo('X1.png', []);
LogoController::deduplicateLogo('X7.png', []);
LogoController::deduplicateLogo('XQ.png', ['sunexpress']);
LogoController::deduplicateLogo('XR_1.png', ['skywest']);
LogoController::deduplicateLogo('XZ.png', []);
LogoController::deduplicateLogo('Y3.png', []);
LogoController::deduplicateLogo('Y8.png', []);
LogoController::deduplicateLogo('Y9.png', []);
LogoController::deduplicateLogo('YB.png', []);
LogoController::deduplicateLogo('YG.png', ['yto-cargo-airlines']);
LogoController::deduplicateLogo('YL.png', ['libyan-wings']);
LogoController::deduplicateLogo('YN.png', ['air-creebec-1994']);
LogoController::deduplicateLogo('YR.png', ['grand-canyon-airlines']);
LogoController::deduplicateLogo('YS.png', []);
LogoController::deduplicateLogo('YV.png', ['mesa-airlines']);
LogoController::deduplicateLogo('YX.png', ['republic-airline']);
LogoController::deduplicateLogo('Z3.png', []);
LogoController::deduplicateLogo('Z6.png', []);
LogoController::deduplicateLogo('ZD.png', ['ewa-air']);
LogoController::deduplicateLogo('ZK.png', []);
LogoController::deduplicateLogo('ZW.png', ['air-wisconsin-airlines-corporation-awac']);
}
private function deDuplicateLogos(){
LogoController::deduplicateLogo('VA.png', ['virgin-australia', 'virgin-australia-regional']);
LogoController::deduplicateLogo('2A.png', []);
LogoController::deduplicateLogo('2C.png', []);
LogoController::deduplicateLogo('2D.png', []);
LogoController::deduplicateLogo('2F.png', []);
LogoController::deduplicateLogo('2G.png', []);
LogoController::deduplicateLogo('2K.png', ['aerogal']);
LogoController::deduplicateLogo('2L.png', ['helvetic-airways-ag']);
LogoController::deduplicateLogo('2N.png', []);
LogoController::deduplicateLogo('2S.png', []);
LogoController::deduplicateLogo('2T.png', []);
LogoController::deduplicateLogo('2U.png', []);
LogoController::deduplicateLogo('2W.png', []);
LogoController::deduplicateLogo('2Y.png', []);
LogoController::deduplicateLogo('3A.png', []);
LogoController::deduplicateLogo('3B.png', []);
LogoController::deduplicateLogo('3C.png', []);
LogoController::deduplicateLogo('3E.png', []);
LogoController::deduplicateLogo('3G.png', []);
LogoController::deduplicateLogo('3L.png', []);
LogoController::deduplicateLogo('3N.png', ['air-urga']);
LogoController::deduplicateLogo('3O.png', ['air-arabia-maroc']);
LogoController::deduplicateLogo('3P.png', []);
LogoController::deduplicateLogo('3T.png', ['tarco-air']);
LogoController::deduplicateLogo('3V.png', ['tnt-airways-s-a']);
LogoController::deduplicateLogo('3W.png', ['malawian-airlines-3w']);
LogoController::deduplicateLogo('3Z.png', []);
LogoController::deduplicateLogo('4A.png', []);
LogoController::deduplicateLogo('4B.png', ['boutique-air']);
LogoController::deduplicateLogo('4F.png', []);
LogoController::deduplicateLogo('4H.png', []);
LogoController::deduplicateLogo('4K.png', []);
LogoController::deduplicateLogo('4L.png', []);
LogoController::deduplicateLogo('4M.png', []);
LogoController::deduplicateLogo('4O.png', []);
LogoController::deduplicateLogo('4R.png', []);
LogoController::deduplicateLogo('4S.png', []);
LogoController::deduplicateLogo('4T.png', []);
LogoController::deduplicateLogo('4U.png', []);
LogoController::deduplicateLogo('4X.png', []);
LogoController::deduplicateLogo('4Y.png', []);
LogoController::deduplicateLogo('5B.png', []);
LogoController::deduplicateLogo('5D.png', []);
LogoController::deduplicateLogo('5F.png', ['fly-one-s-r-l']);
LogoController::deduplicateLogo('5H.png', []);
LogoController::deduplicateLogo('5H.png', []);
LogoController::deduplicateLogo('5I.png', ['alsa-grupo-slu']);
LogoController::deduplicateLogo('5L.png', ['asl-airlines-france']);
LogoController::deduplicateLogo('5O.png', []);
LogoController::deduplicateLogo('5R.png', ['rutaca-airlines']);
LogoController::deduplicateLogo('5T.png', ['canadian-north']);
LogoController::deduplicateLogo('5Y.png', ['atlas-air']);
LogoController::deduplicateLogo('5Z.png', ['cemair']);
LogoController::deduplicateLogo('6A.png', ['armenia-airways-aircompany-cjsc']);
LogoController::deduplicateLogo('6B.png', ['tuifly-nordic-ab']);
LogoController::deduplicateLogo('6D.png', []);
LogoController::deduplicateLogo('6E.png', ['interglobe-aviation-dba-indigo']);
LogoController::deduplicateLogo('6F.png', []);
LogoController::deduplicateLogo('6G.png', []);
LogoController::deduplicateLogo('6J.png', ['solaseed-air']);
LogoController::deduplicateLogo('6K.png', []);
LogoController::deduplicateLogo('6N.png', ['niger-airlines-s-a']);
LogoController::deduplicateLogo('6P.png', []);
LogoController::deduplicateLogo('6R.png', ['alrosa-air', 'alrosa-mirny-air-enterprise', 'open-joint-stock-alrosa-mirny-air-enterprise']);
LogoController::deduplicateLogo('6V.png', []);
LogoController::deduplicateLogo('7B.png', []);
LogoController::deduplicateLogo('7C.png', ['jeju-air']);
LogoController::deduplicateLogo('7E.png', ['sylt-air-gmbh']);
LogoController::deduplicateLogo('7G.png', ['star-flyer']);
LogoController::deduplicateLogo('7I.png', ['inselair']);
LogoController::deduplicateLogo('7K.png', []);
LogoController::deduplicateLogo('7L.png', ['silk-way-west-airlines']);
LogoController::deduplicateLogo('7O.png', []);
LogoController::deduplicateLogo('7P.png', ['air-panama-dba-parsa']);
LogoController::deduplicateLogo('7Q.png', []);
LogoController::deduplicateLogo('7T.png', []);
LogoController::deduplicateLogo('7V.png', ['federal-air']);
LogoController::deduplicateLogo('7W.png', ['wind-rose-aviation']);
LogoController::deduplicateLogo('7Y.png', ['mann-yadanarpon-airlines']);
LogoController::deduplicateLogo('7Z.png', ['']);
LogoController::deduplicateLogo('8B.png', ['pt-transnusa-aviation-mandiri']);
LogoController::deduplicateLogo('8C.png', ['']);
LogoController::deduplicateLogo('8F.png', ['stp-airways']);
LogoController::deduplicateLogo('8G.png', []);
LogoController::deduplicateLogo('8H.png', ['bh-air']);
LogoController::deduplicateLogo('8J.png', ['linea-aerea-eco-jet-s-a']);
LogoController::deduplicateLogo('8K.png', ['k-mile-air']);
LogoController::deduplicateLogo('8L.png', ['lucky-air']);
LogoController::deduplicateLogo('8M.png', ['myanmar-airways-international']);
LogoController::deduplicateLogo('8R.png', []);
LogoController::deduplicateLogo('8S.png', []);
LogoController::deduplicateLogo('8U.png', ['afriqiyah-airways']);
LogoController::deduplicateLogo('8W.png', ['fly-all-ways', 'fly-always-n-v']);
LogoController::deduplicateLogo('8Y.png', []);
LogoController::deduplicateLogo('9D.png', []);
LogoController::deduplicateLogo('9E.png', ['endeavor-air']);
LogoController::deduplicateLogo('9F.png', []);
LogoController::deduplicateLogo('9G.png', []);
LogoController::deduplicateLogo('9H.png', ['chang-an-airlines']);
LogoController::deduplicateLogo('9I.png', ['airline-allied-limited-dba-alliance-air']);
LogoController::deduplicateLogo('9K.png', ['cape-air']);
LogoController::deduplicateLogo('9N.png', ['tropic-air']);
LogoController::deduplicateLogo('9P.png', []);
LogoController::deduplicateLogo('9R.png', []);
LogoController::deduplicateLogo('9S.png', []);
LogoController::deduplicateLogo('9T.png', []);
LogoController::deduplicateLogo('9V.png', ['c-a']);
LogoController::deduplicateLogo('9X.png', ['southern-airways-express']);
LogoController::deduplicateLogo('9Y.png', []);
LogoController::deduplicateLogo('A2.png', []);
LogoController::deduplicateLogo('A7.png', []);
LogoController::deduplicateLogo('AD.png', ['azul-brazilian-airlines']);
LogoController::deduplicateLogo('AE.png', ['mandarin-airlines']);
LogoController::deduplicateLogo('AG.png', []);
LogoController::deduplicateLogo('AJ.png', ['aztec-worldwide-airlines']);
LogoController::deduplicateLogo('AK.png', ['airasia-berhad-dba-airasia']);
LogoController::deduplicateLogo('AM.png', ['aeromexico']);
LogoController::deduplicateLogo('AN.png', []);
LogoController::deduplicateLogo('AO.png', []);
LogoController::deduplicateLogo('AP.png', []);
LogoController::deduplicateLogo('AQ.png', ['nine-air']);
LogoController::deduplicateLogo('AW.png', ['africa-world-airlines']);
LogoController::deduplicateLogo('AX.png', []);
LogoController::deduplicateLogo('B3.png', ['bhutan-airlines']);
LogoController::deduplicateLogo('B6.png', ['jetblue']);
LogoController::deduplicateLogo('B7.png', []);
LogoController::deduplicateLogo('BA.png', ['british-airways']);
LogoController::deduplicateLogo('BB.png', ['seaborne-airlines']);
LogoController::deduplicateLogo('BC.png', ['skymark-airlines']);
LogoController::deduplicateLogo('BE.png', []);
LogoController::deduplicateLogo('BF.png', []);
LogoController::deduplicateLogo('BG.png', ['biman']);
LogoController::deduplicateLogo('BH.png', []);
LogoController::deduplicateLogo('BI.png', ['royal-brunei']);
LogoController::deduplicateLogo('BJ.png', ['nouvelair']);
LogoController::deduplicateLogo('BK.png', ['okay-airways']);
LogoController::deduplicateLogo('BL.png', []);
LogoController::deduplicateLogo('BM.png', []);
LogoController::deduplicateLogo('BQ.png', []);
LogoController::deduplicateLogo('BR.png', ['eva-air']);
LogoController::deduplicateLogo('BS.png', ['us-bangla-airlines']);
LogoController::deduplicateLogo('BT.png', ['air-baltic']);
LogoController::deduplicateLogo('BU.png', ['compagnie-africaine-d-aviation-caa']);
LogoController::deduplicateLogo('BV.png', []);
LogoController::deduplicateLogo('BX.png', ['air-busan']);
LogoController::deduplicateLogo('BZ.png', ['']);
LogoController::deduplicateLogo('C3.png', ['trade-air']);
LogoController::deduplicateLogo('C5.png', ['commutair']);
LogoController::deduplicateLogo('C6.png', []);
LogoController::deduplicateLogo('C7.png', ['cinnamon-air']);
LogoController::deduplicateLogo('C8.png', ['cargolux-italia-s-p-a']);
LogoController::deduplicateLogo('C9.png', []);
LogoController::deduplicateLogo('CA.png', ['air-china']);
LogoController::deduplicateLogo('CB.png', []);
LogoController::deduplicateLogo('CD.png', ['corendon-dutch-airlines-b-v']);
LogoController::deduplicateLogo('CE.png', ['chalair-aviation']);
LogoController::deduplicateLogo('CF.png', ['china-postal-airlines']);
LogoController::deduplicateLogo('CG.png', ['airlines-of-papua-new-guinea']);
LogoController::deduplicateLogo('CH.png', []);
LogoController::deduplicateLogo('CJ.png', ['ba-cityflyer']);
LogoController::deduplicateLogo('CL.png', ['lufthansa-cityline']);
LogoController::deduplicateLogo('CN.png', ['grand-china-air']);
LogoController::deduplicateLogo('CO.png', []);
LogoController::deduplicateLogo('CP.png', []);
LogoController::deduplicateLogo('CQ.png', ['coastal-aviation', 'coastal-travels-cq']);
LogoController::deduplicateLogo('CS.png', []);
LogoController::deduplicateLogo('CV.png', ['cargolux-s-a']);
LogoController::deduplicateLogo('CW.png', []);
LogoController::deduplicateLogo('CZ.png', ['china-southern-airlines']);
LogoController::deduplicateLogo('D2.png', ['severstal-aircompany']);
LogoController::deduplicateLogo('D5.png', ['dhl-aero-expreso-s-a']);
LogoController::deduplicateLogo('D7.png', ['airasia-x-berhad-dba-airasia-x', 'airasia-x-malaysia']);
LogoController::deduplicateLogo('DD.png', ['nok-airlines-public-limited-dba-nok-air']);
LogoController::deduplicateLogo('DG.png', []);
LogoController::deduplicateLogo('DH.png', []);
LogoController::deduplicateLogo('DI.png', []);
LogoController::deduplicateLogo('DJ.png', []);
LogoController::deduplicateLogo('DK.png', []);
LogoController::deduplicateLogo('DM.png', []);
LogoController::deduplicateLogo('DN.png', []);
LogoController::deduplicateLogo('DO.png', []);
LogoController::deduplicateLogo('DP.png', ['pobeda']);
LogoController::deduplicateLogo('DQ.png', []);
LogoController::deduplicateLogo('DR.png', ['ruili-airlines']);
LogoController::deduplicateLogo('DS.png', ['easyjet-switzerland-s-a']);
LogoController::deduplicateLogo('DU.png', []);
LogoController::deduplicateLogo('DV.png', ['jsc-aircompany-scat']);
LogoController::deduplicateLogo('DX.png', ['danish-air-transport']);
LogoController::deduplicateLogo('DY.png', ['norwegian-air-shuttle-a-s']);
LogoController::deduplicateLogo('DZ.png', ['donghai-airlines']);
LogoController::deduplicateLogo('E2.png', ['eurowings-europe-gmbh']);
LogoController::deduplicateLogo('E4.png', []);
LogoController::deduplicateLogo('E5.png', ['air-arabia-egypt']);
LogoController::deduplicateLogo('E6.png', []);
LogoController::deduplicateLogo('E9.png', []);
LogoController::deduplicateLogo('EA.png', []);
LogoController::deduplicateLogo('EB.png', ['wamos-air']);
LogoController::deduplicateLogo('EC.png', []);
LogoController::deduplicateLogo('ED.png', ['airexplore']);
LogoController::deduplicateLogo('EG.png', []);
LogoController::deduplicateLogo('EH.png', ['ana-wings']);
LogoController::deduplicateLogo('EJ.png', []);
LogoController::deduplicateLogo('EK.png', ['emirates']);
LogoController::deduplicateLogo('EN.png', []);
LogoController::deduplicateLogo('EO.png', []);
LogoController::deduplicateLogo('EP.png', ['iran-aseman-airlines']);
LogoController::deduplicateLogo('EQ.png', []);
LogoController::deduplicateLogo('ER.png', []);
LogoController::deduplicateLogo('ES.png', []);
LogoController::deduplicateLogo('EU.png', ['chengdu-airlines']);
LogoController::deduplicateLogo('EW.png', ['eurowings']);
LogoController::deduplicateLogo('EX.png', []);
LogoController::deduplicateLogo('EY.png', ['etihad-airways']);
LogoController::deduplicateLogo('EZ.png', ['sun-air-of-scandinavia-a-s']);
LogoController::deduplicateLogo('F2.png', []);
LogoController::deduplicateLogo('F4.png', []);
LogoController::deduplicateLogo('F5.png', ['aerotranscargo']);
LogoController::deduplicateLogo('F6.png', []);
LogoController::deduplicateLogo('F7.png', []);
LogoController::deduplicateLogo('F8.png', ['flair-airlines']);
LogoController::deduplicateLogo('F9.png', ['frontier', 'frontier-airlines']);
LogoController::deduplicateLogo('FA.png', ['safair']);
LogoController::deduplicateLogo('FB.png', ['bulgaria-air']);
LogoController::deduplicateLogo('FC.png', []);
LogoController::deduplicateLogo('FD.png', ['thai-airasia']);
LogoController::deduplicateLogo('FE.png', []);
LogoController::deduplicateLogo('FH.png', ['freebird-airlines']);
LogoController::deduplicateLogo('FL.png', []);
LogoController::deduplicateLogo('FM.png', ['shanghai-airlines']);
LogoController::deduplicateLogo('FN.png', ['fastjet-airlines']);
LogoController::deduplicateLogo('FO.png', []);
LogoController::deduplicateLogo('FP.png', []);
LogoController::deduplicateLogo('FR.png', ['ryanair']);
LogoController::deduplicateLogo('FS.png', []);
LogoController::deduplicateLogo('FT.png', []);
LogoController::deduplicateLogo('FU.png', ['fuzhou-airlines']);
LogoController::deduplicateLogo('FV.png', ['rossiya-airlines']);
LogoController::deduplicateLogo('FW.png', ['ibex-airlines']);
LogoController::deduplicateLogo('FX.png', ['federal-express']);
LogoController::deduplicateLogo('FY.png', ['flyfirefly-sdn-bhd']);
LogoController::deduplicateLogo('FZ.png', ['flydubai']);
LogoController::deduplicateLogo('G2.png', []);
LogoController::deduplicateLogo('G3.png', ['gol-airlines']);
LogoController::deduplicateLogo('G8.png', []);
LogoController::deduplicateLogo('GC.png', []);
LogoController::deduplicateLogo('GD.png', []);
LogoController::deduplicateLogo('GE.png', []);
LogoController::deduplicateLogo('GF.png', ['gulf-air']);
LogoController::deduplicateLogo('GH.png', []);
LogoController::deduplicateLogo('GI.png', []);
LogoController::deduplicateLogo('GJ.png', ['zhejiang-loong-airlines']);
LogoController::deduplicateLogo('GK.png', ['jetstar-japan']);
LogoController::deduplicateLogo('GO.png', ['uls-airlines-cargo']);
LogoController::deduplicateLogo('GP.png', []);
LogoController::deduplicateLogo('GQ.png', ['sky-express-s-a']);
LogoController::deduplicateLogo('GR.png', ['aurigny-air-limited']);
LogoController::deduplicateLogo('GS.png', ['tianjin-airlines']);
LogoController::deduplicateLogo('GT.png', ['air-guilin']);
LogoController::deduplicateLogo('GV.png', []);
LogoController::deduplicateLogo('GW.png', []);
LogoController::deduplicateLogo('GX.png', ['guangxi-beibu-gulf-airlines']);
LogoController::deduplicateLogo('GY.png', ['colorful-guizhou-airlines']);
LogoController::deduplicateLogo('GZ.png', ['air-rarotonga']);
LogoController::deduplicateLogo('H1.png', ['hahn-air-systems']);
LogoController::deduplicateLogo('H4.png', []);
LogoController::deduplicateLogo('H5.png', []);
LogoController::deduplicateLogo('H6.png', ['bulgarian-air-charter']);
LogoController::deduplicateLogo('H7.png', []);
LogoController::deduplicateLogo('H8.png', []);
LogoController::deduplicateLogo('H9.png', ['himalaya-airlines-pvt']);
LogoController::deduplicateLogo('HB.png', []);
LogoController::deduplicateLogo('HC.png', []);
LogoController::deduplicateLogo('HD.png', ['air-do']);
LogoController::deduplicateLogo('HE.png', []);
LogoController::deduplicateLogo('HH.png', []);
LogoController::deduplicateLogo('HJ.png', []);
LogoController::deduplicateLogo('HK.png', ['skippers-aviation']);
LogoController::deduplicateLogo('HM.png', ['air-seychelles']);
LogoController::deduplicateLogo('HN.png', []);
LogoController::deduplicateLogo('HO.png', ['juneyao-airlines']);
LogoController::deduplicateLogo('HP.png', []);
LogoController::deduplicateLogo('HQ.png', []);
LogoController::deduplicateLogo('HR.png', ['hahn-air']);
LogoController::deduplicateLogo('HT.png', []);
LogoController::deduplicateLogo('HU.png', ['hainan-airlines']);
LogoController::deduplicateLogo('HV.png', []);
LogoController::deduplicateLogo('HW.png', ['north-wright-airways']);
LogoController::deduplicateLogo('HX.png', ['hong-kong-airlines']);
LogoController::deduplicateLogo('HY.png', ['uzbekistan-airways']);
LogoController::deduplicateLogo('HZ.png', ['joint-stock-aurora-airlines']);
LogoController::deduplicateLogo('I2.png', ['compania-operadora-de-corto-y-medio-radio-iberia-express']);
LogoController::deduplicateLogo('I6.png', []);
LogoController::deduplicateLogo('I8.png', ['izhavia-public-stock']);
LogoController::deduplicateLogo('ID.png', ['pt-batik-air-indonesia']);
LogoController::deduplicateLogo('IF.png', []);
LogoController::deduplicateLogo('IH.png', []);
LogoController::deduplicateLogo('IJ.png', ['spring-airlines-japan', 'spring-japan']);
LogoController::deduplicateLogo('IK.png', []);
LogoController::deduplicateLogo('IL.png', ['pt-trigana-air']);
LogoController::deduplicateLogo('IN.png', ['nam-air']);
LogoController::deduplicateLogo('IO.png', []);
LogoController::deduplicateLogo('IP.png', []);
LogoController::deduplicateLogo('IQ.png', []);
LogoController::deduplicateLogo('IS.png', []);
LogoController::deduplicateLogo('IT.png', ['tigerair-taiwan']);
LogoController::deduplicateLogo('IU.png', []);
LogoController::deduplicateLogo('IV.png', []);
LogoController::deduplicateLogo('IW.png', ['pt-wings-abadi-airlines']);
LogoController::deduplicateLogo('IX.png', []);
LogoController::deduplicateLogo('J1.png', []);
LogoController::deduplicateLogo('J4.png', ['badr-airlines']);
LogoController::deduplicateLogo('J5.png', ['alaska-seaplane', 'alaska-seaplane-j5']);
LogoController::deduplicateLogo('J6.png', ['japan-air-commuter']);
LogoController::deduplicateLogo('J7.png', []);
LogoController::deduplicateLogo('J9.png', ['jazeera-airways']);
LogoController::deduplicateLogo('JA.png', []);
LogoController::deduplicateLogo('JB.png', []);
LogoController::deduplicateLogo('JC.png', ['japan-air-commuter']);
LogoController::deduplicateLogo('JD.png', ['beijing-capital-airlines']);
LogoController::deduplicateLogo('JE.png', ['mango-airlines-soc-trading-as-mango']);
LogoController::deduplicateLogo('JG.png', []);
LogoController::deduplicateLogo('JH.png', ['fuji-dream-airlines']);
LogoController::deduplicateLogo('JI.png', []);
LogoController::deduplicateLogo('JM.png', []);
LogoController::deduplicateLogo('JP.png', []);
LogoController::deduplicateLogo('JQ.png', ['jetstar-airways-pty']);
LogoController::deduplicateLogo('JS.png', ['air-koryo']);
LogoController::deduplicateLogo('JT.png', ['lion-airlines']);
LogoController::deduplicateLogo('JU.png', ['air-serbia-a-d-beograd']);
LogoController::deduplicateLogo('JX.png', []);
LogoController::deduplicateLogo('JY.png', ['intercaribbean-airways']);
LogoController::deduplicateLogo('JZ.png', []);
LogoController::deduplicateLogo('K4.png', []);
LogoController::deduplicateLogo('K6.png', ['cambodia-angkor-air-t-a-cambodia-angkor-air']);
LogoController::deduplicateLogo('K7.png', []);
LogoController::deduplicateLogo('K9.png', []);
LogoController::deduplicateLogo('KA.png', []);
LogoController::deduplicateLogo('KB.png', ['druk-air-corporation']);
LogoController::deduplicateLogo('KC.png', ['air-astana']);
LogoController::deduplicateLogo('KD.png', []);
LogoController::deduplicateLogo('KG.png', []);
LogoController::deduplicateLogo('KK.png', []);
LogoController::deduplicateLogo('KN.png', []);
LogoController::deduplicateLogo('KP.png', []);
LogoController::deduplicateLogo('KQ.png', ['kenya-airways']);
LogoController::deduplicateLogo('KR.png', []);
LogoController::deduplicateLogo('KS.png', []);
LogoController::deduplicateLogo('KT.png', []);
LogoController::deduplicateLogo('KV.png', []);
LogoController::deduplicateLogo('KW.png', []);
LogoController::deduplicateLogo('KY.png', ['kunming-airlines']);
LogoController::deduplicateLogo('KZ.png', ['nippon-cargo-airlines-nca']);
LogoController::deduplicateLogo('L2.png', []);
LogoController::deduplicateLogo('L3.png', ['dhl-de-guatemala-s-a']);
LogoController::deduplicateLogo('L6.png', ['mauritanian-airlines-international']);
LogoController::deduplicateLogo('L7.png', []);
LogoController::deduplicateLogo('L8.png', []);
LogoController::deduplicateLogo('LB.png', []);
LogoController::deduplicateLogo('LC.png', []);
LogoController::deduplicateLogo('LD.png', []);
LogoController::deduplicateLogo('LF.png', []);
LogoController::deduplicateLogo('LH.png', ['lufthansa', 'lufthansa-cargo']);
LogoController::deduplicateLogo('LJ.png', ['jin-air']);
LogoController::deduplicateLogo('LK.png', ['lao-skyway']);
LogoController::deduplicateLogo('LL.png', []);
LogoController::deduplicateLogo('LM.png', ['loganair']);
LogoController::deduplicateLogo('LN.png', ['libyan-airlines']);
LogoController::deduplicateLogo('LP.png', []);
LogoController::deduplicateLogo('LS.png', ['jet2-com']);
LogoController::deduplicateLogo('LU.png', []);
LogoController::deduplicateLogo('LW.png', []);
LogoController::deduplicateLogo('LX.png', ['swiss']);
LogoController::deduplicateLogo('LZ.png', []);
LogoController::deduplicateLogo('M2.png', []);
LogoController::deduplicateLogo('M4.png', ['mistral-air']);
LogoController::deduplicateLogo('M7.png', ['mas-air']);
LogoController::deduplicateLogo('M8.png', []);
LogoController::deduplicateLogo('MB.png', []);
LogoController::deduplicateLogo('MD.png', ['air-madagascar']);
LogoController::deduplicateLogo('MF.png', ['xiamen-airlines']);
LogoController::deduplicateLogo('MG.png', []);
LogoController::deduplicateLogo('MI.png', []);
LogoController::deduplicateLogo('MJ.png', []);
LogoController::deduplicateLogo('ML.png', []);
LogoController::deduplicateLogo('MO.png', ['calm-air-international']);
LogoController::deduplicateLogo('MQ.png', ['envoy-air']);
LogoController::deduplicateLogo('MR.png', ['hunnu-air']);
LogoController::deduplicateLogo('MS.png', ['egyptair']);
LogoController::deduplicateLogo('MT.png', []);
LogoController::deduplicateLogo('MU.png', ['china-eastern']);
LogoController::deduplicateLogo('MV.png', []);
LogoController::deduplicateLogo('MW.png', []);
LogoController::deduplicateLogo('MY.png', []);
LogoController::deduplicateLogo('MZ.png', ['amakusa-airlines']);
LogoController::deduplicateLogo('N2.png', []);
LogoController::deduplicateLogo('N3.png', []);
LogoController::deduplicateLogo('N4.png', ['nord-wind']);
LogoController::deduplicateLogo('N5.png', []);
LogoController::deduplicateLogo('N7.png', []);
LogoController::deduplicateLogo('N8.png', ['national-airlines']);
LogoController::deduplicateLogo('N9.png', []);
LogoController::deduplicateLogo('NA.png', []);
LogoController::deduplicateLogo('NB.png', []);
LogoController::deduplicateLogo('NE.png', ['nesma-airlines']);
LogoController::deduplicateLogo('NF.png', ['air-vanuatu-operations']);
LogoController::deduplicateLogo('NG.png', ['']);
LogoController::deduplicateLogo('NI.png', []);
LogoController::deduplicateLogo('NJ.png', []);
LogoController::deduplicateLogo('NK.png', ['spirit', 'spirit-airlines']);
LogoController::deduplicateLogo('NL.png', []);
LogoController::deduplicateLogo('NM.png', []);
LogoController::deduplicateLogo('NN.png', []);
LogoController::deduplicateLogo('NO.png', []);
LogoController::deduplicateLogo('NP.png', ['nile-air']);
LogoController::deduplicateLogo('NQ.png', []);
LogoController::deduplicateLogo('NR.png', []);
LogoController::deduplicateLogo('NS.png', ['hebei-airlines']);
LogoController::deduplicateLogo('NT.png', ['binter-canarias']);
LogoController::deduplicateLogo('NU.png', []);
LogoController::deduplicateLogo('NX.png', ['air-macau']);
LogoController::deduplicateLogo('NZ.png', ['air-new-zealand']);
LogoController::deduplicateLogo('O9.png', []);
LogoController::deduplicateLogo('OB.png', ['boliviana-de-aviacion-boa']);
LogoController::deduplicateLogo('OC.png', ['oriental-air-bridge']);
LogoController::deduplicateLogo('OD.png', ['malindo-airways-sdn-bhd-malindo-a']);
LogoController::deduplicateLogo('OE.png', []);
LogoController::deduplicateLogo('OF.png', []);
LogoController::deduplicateLogo('OI.png', ['hinterland-aviation-pty']);
LogoController::deduplicateLogo('OJ.png', []);
LogoController::deduplicateLogo('OL.png', []);
LogoController::deduplicateLogo('OP.png', []);
LogoController::deduplicateLogo('OQ.png', ['chongqing-airlines']);
LogoController::deduplicateLogo('OR.png', ['arkefly']);
LogoController::deduplicateLogo('OU.png', ['croatia-airlines']);
LogoController::deduplicateLogo('OV.png', []);
LogoController::deduplicateLogo('OW.png', []);
LogoController::deduplicateLogo('OY.png', []);
LogoController::deduplicateLogo('OZ.png', ['asiana']);
LogoController::deduplicateLogo('P3.png', []);
LogoController::deduplicateLogo('P4.png', []);
LogoController::deduplicateLogo('P7.png', []);
LogoController::deduplicateLogo('P8.png', ['sprintair-sa']);
LogoController::deduplicateLogo('PA.png', ['airblue']);
LogoController::deduplicateLogo('PB.png', []);
LogoController::deduplicateLogo('PC.png', ['pegasus-airlines']);
LogoController::deduplicateLogo('PD.png', ['porter-airlines']);
LogoController::deduplicateLogo('PE.png', []);
LogoController::deduplicateLogo('PF.png', []);
LogoController::deduplicateLogo('PG.png', ['bangkok-air']);
LogoController::deduplicateLogo('PI.png', ['polar-airlines-ojsc']);
LogoController::deduplicateLogo('PJ.png', ['air-saint-pierre']);
LogoController::deduplicateLogo('PL.png', ['southern-air-charter']);
LogoController::deduplicateLogo('PM.png', ['canary-fly']);
LogoController::deduplicateLogo('PN.png', ['china-west-air']);
LogoController::deduplicateLogo('PO.png', ['polar-air-cargo-worldwide']);
LogoController::deduplicateLogo('PQ.png', []);
LogoController::deduplicateLogo('PS.png', ['ukraine-international-airlines']);
LogoController::deduplicateLogo('PT.png', ['piedmont-airlines']);
LogoController::deduplicateLogo('PU.png', ['s-a']);
LogoController::deduplicateLogo('PV.png', []);
LogoController::deduplicateLogo('PW.png', []);
LogoController::deduplicateLogo('PX.png', ['air-niugini']);
LogoController::deduplicateLogo('Q3.png', ['anguilla-air']);
LogoController::deduplicateLogo('Q4.png', []);
LogoController::deduplicateLogo('Q5.png', []);
LogoController::deduplicateLogo('Q6.png', []);
LogoController::deduplicateLogo('Q7.png', []);
LogoController::deduplicateLogo('Q9.png', []);
LogoController::deduplicateLogo('QB.png', ['qeshm-air']);
LogoController::deduplicateLogo('QC.png', []);
LogoController::deduplicateLogo('QG.png', ['pt-citilink-indonesia']);
LogoController::deduplicateLogo('QH.png', []);
LogoController::deduplicateLogo('QK.png', ['jazz-aviation-lp']);
LogoController::deduplicateLogo('QL.png', ['laser-airlines']);
LogoController::deduplicateLogo('QN.png', []);
LogoController::deduplicateLogo('QP.png', []);
LogoController::deduplicateLogo('QQ.png', ['alliance-airlines']);
LogoController::deduplicateLogo('QR.png', ['qatar-airways']);
LogoController::deduplicateLogo('QS.png', ['smartwings']);
LogoController::deduplicateLogo('QT.png', []);
LogoController::deduplicateLogo('QU.png', []);
LogoController::deduplicateLogo('QV.png', ['lao-airlines']);
LogoController::deduplicateLogo('QW.png', ['qingdao-airlines']);
LogoController::deduplicateLogo('QX.png', ['horizon-air-industries']);
LogoController::deduplicateLogo('QZ.png', ['airasia-indonesia']);
LogoController::deduplicateLogo('R3.png', []);
LogoController::deduplicateLogo('R4.png', []);
LogoController::deduplicateLogo('R5.png', ['jordan-aviation']);
LogoController::deduplicateLogo('R6.png', []);
LogoController::deduplicateLogo('R8.png', []);
LogoController::deduplicateLogo('RC.png', ['atlantic-airways']);
LogoController::deduplicateLogo('RD.png', []);
LogoController::deduplicateLogo('RF.png', []);
LogoController::deduplicateLogo('RG.png', ['rotana-jet-aviation-dba-rotana-jet']);
LogoController::deduplicateLogo('RH.png', []);
LogoController::deduplicateLogo('RI.png', []);
LogoController::deduplicateLogo('RK.png', []);
LogoController::deduplicateLogo('RN.png', []);
LogoController::deduplicateLogo('RP.png', []);
LogoController::deduplicateLogo('RQ.png', ['kam-air']);
LogoController::deduplicateLogo('RS.png', []);
LogoController::deduplicateLogo('RT.png', []);
LogoController::deduplicateLogo('RV.png', ['air-canada-rouge']);
LogoController::deduplicateLogo('RW.png', []);
LogoController::deduplicateLogo('RX.png', []);
LogoController::deduplicateLogo('RY.png', ['jiangxi-air-limited-dba-jiangxi-air']);
LogoController::deduplicateLogo('RZ.png', ['servicios-aereos-nacionales-s-a-sansa']);
LogoController::deduplicateLogo('S1.png', ['lufthansa-systems-ag']);
LogoController::deduplicateLogo('S5.png', []);
LogoController::deduplicateLogo('S6.png', ['sunrise-airways-s-a']);
LogoController::deduplicateLogo('S8.png', ['sounds-air-travel-tourism']);
LogoController::deduplicateLogo('SB.png', ['aircalin']);
LogoController::deduplicateLogo('SC.png', ['shandong-airlines']);
LogoController::deduplicateLogo('SE.png', []);
LogoController::deduplicateLogo('SF.png', ['tassili-airlines']);
LogoController::deduplicateLogo('SG.png', ['spicejet']);
LogoController::deduplicateLogo('SH.png', ['sharp-airlines']);
LogoController::deduplicateLogo('SJ.png', ['pt-sriwijaya-air']);
LogoController::deduplicateLogo('SL.png', ['thai-lion-air', 'thai-lion-mentari']);
LogoController::deduplicateLogo('SM.png', ['air-cairo']);
LogoController::deduplicateLogo('SO.png', []);
LogoController::deduplicateLogo('SP.png', ['sata-air-acores']);
LogoController::deduplicateLogo('SQ.png', ['sia-cargo']);
LogoController::deduplicateLogo('SS.png', ['corsair']);
LogoController::deduplicateLogo('ST.png', []);
LogoController::deduplicateLogo('SY.png', []);
LogoController::deduplicateLogo('SZ.png', ['aircompany-somon-air']);
LogoController::deduplicateLogo('T2.png', []);
LogoController::deduplicateLogo('T5.png', ['turkmenistan-airlines']);
LogoController::deduplicateLogo('T6.png', ['island-transvoyager']);
LogoController::deduplicateLogo('T7.png', ['twin-jet']);
LogoController::deduplicateLogo('T9.png', ['turpial']);
LogoController::deduplicateLogo('TA.png', []);
LogoController::deduplicateLogo('TB.png', ['tui-airlines-belgium-t-a-jetairfly']);
LogoController::deduplicateLogo('TC.png', ['air-tanzania-ltd']);
LogoController::deduplicateLogo('TD.png', []);
LogoController::deduplicateLogo('TE.png', ['sky-taxi-sp-z-o-o']);
LogoController::deduplicateLogo('TF.png', ['braathens-regional-aviation-ab']);
LogoController::deduplicateLogo('TH.png', []);
LogoController::deduplicateLogo('TI.png', ['tailwind-hava-yollari-a-s']);
LogoController::deduplicateLogo('TJ.png', ['tradewind-aviation']);
LogoController::deduplicateLogo('TL.png', []);
LogoController::deduplicateLogo('TM.png', ['lam']);
LogoController::deduplicateLogo('TN.png', ['air-tahiti-nui']);
LogoController::deduplicateLogo('TO.png', ['transavia-france']);
LogoController::deduplicateLogo('TR.png', ['scoot-private']);
LogoController::deduplicateLogo('TS.png', ['air-transat']);
LogoController::deduplicateLogo('TT.png', []);
LogoController::deduplicateLogo('TV.png', ['tibet-airlines-corporation']);
LogoController::deduplicateLogo('TW.png', ['t-way-air']);
LogoController::deduplicateLogo('TX.png', ['air-caraibes']);
LogoController::deduplicateLogo('TZ.png', ['tsaradia']);
LogoController::deduplicateLogo('U4.png', ['buddha-air']);
LogoController::deduplicateLogo('U7.png', ['uniworld-air-cargo-corp']);
LogoController::deduplicateLogo('U8.png', ['tus-airways']);
LogoController::deduplicateLogo('UA.png', ['united-airlines']);
LogoController::deduplicateLogo('UB.png', ['myanmar-national-airlines']);
LogoController::deduplicateLogo('UC.png', []);
LogoController::deduplicateLogo('UD.png', []);
LogoController::deduplicateLogo('UF.png', []);
LogoController::deduplicateLogo('UG.png', ['tunisair-express']);
LogoController::deduplicateLogo('UI.png', ['auric-air-limited']);
LogoController::deduplicateLogo('UJ.png', []);
LogoController::deduplicateLogo('UL.png', ['srilankan-airlines']);
LogoController::deduplicateLogo('UM.png', ['air-zimbabwe-pvt']);
LogoController::deduplicateLogo('UN.png', []);
LogoController::deduplicateLogo('UO.png', ['hong-kong-express-airways']);
LogoController::deduplicateLogo('UP.png', ['bahamasair']);
LogoController::deduplicateLogo('UQ.png', ['urumqi-airlines']);
LogoController::deduplicateLogo('UR.png', []);
LogoController::deduplicateLogo('US.png', ['us-airways']);
LogoController::deduplicateLogo('UX.png', ['air-europa']);
LogoController::deduplicateLogo('UY.png', []);
LogoController::deduplicateLogo('UZ.png', ['buraq-air']);
LogoController::deduplicateLogo('V3.png', ['carpatair']);
LogoController::deduplicateLogo('V5.png', []);
LogoController::deduplicateLogo('V6.png', []);
LogoController::deduplicateLogo('V8.png', []);
LogoController::deduplicateLogo('VB.png', ['aeroenlaces-nacionales-s-a-de-c-v']);
LogoController::deduplicateLogo('VC.png', []);
LogoController::deduplicateLogo('VD.png', []);
LogoController::deduplicateLogo('VE.png', []);
LogoController::deduplicateLogo('VF.png', []);
LogoController::deduplicateLogo('VJ.png', ['vietjet-aviation-joint-stock']);
LogoController::deduplicateLogo('VK.png', []);
LogoController::deduplicateLogo('VL.png', []);
LogoController::deduplicateLogo('VM.png', ['max-air']);
LogoController::deduplicateLogo('VN.png', ['vietnam-airlines']);
LogoController::deduplicateLogo('VP.png', ['flyme']);
LogoController::deduplicateLogo('VQ.png', ['novoair']);
LogoController::deduplicateLogo('VS.png', ['virgin-atlantic']);
LogoController::deduplicateLogo('VU.png', []);
LogoController::deduplicateLogo('VV.png', []);
LogoController::deduplicateLogo('VX.png', ['virgin-america']);
LogoController::deduplicateLogo('VY.png', ['vueling']);
LogoController::deduplicateLogo('VZ.png', []);
LogoController::deduplicateLogo('W2.png', ['flexflight-aps']);
LogoController::deduplicateLogo('W3.png', ['arik-air']);
LogoController::deduplicateLogo('W4.png', []);
LogoController::deduplicateLogo('W6.png', ['wizz-air']);
LogoController::deduplicateLogo('W7.png', []);
LogoController::deduplicateLogo('W8.png', ['cargojet-airways']);
LogoController::deduplicateLogo('W9.png', []);
LogoController::deduplicateLogo('WA.png', ['klm-cityhopper']);
LogoController::deduplicateLogo('WB.png', ['rwandair']);
LogoController::deduplicateLogo('WD.png', []);
LogoController::deduplicateLogo('WE.png', []);
LogoController::deduplicateLogo('WH.png', []);
LogoController::deduplicateLogo('WI.png', []);
LogoController::deduplicateLogo('WJ.png', []);
LogoController::deduplicateLogo('WK.png', ['edelweiss-air']);
LogoController::deduplicateLogo('WL.png', []);
LogoController::deduplicateLogo('WN.png', ['southwest-airlines']);
LogoController::deduplicateLogo('WO.png', []);
LogoController::deduplicateLogo('WP.png', []);
LogoController::deduplicateLogo('WR.png', ['westjet-encore']);
LogoController::deduplicateLogo('WS.png', ['westjet']);
LogoController::deduplicateLogo('WT.png', []);
LogoController::deduplicateLogo('WU.png', []);
LogoController::deduplicateLogo('WV.png', []);
LogoController::deduplicateLogo('WW.png', []);
LogoController::deduplicateLogo('WZ.png', ['airlines-400']);
LogoController::deduplicateLogo('X3.png', ['tuifly']);
LogoController::deduplicateLogo('X4.png', []);
LogoController::deduplicateLogo('X5.png', []);
LogoController::deduplicateLogo('X9.png', ['jsc-avion-express']);
LogoController::deduplicateLogo('XC.png', ['corendon-airlines']);
LogoController::deduplicateLogo('XD.png', []);
LogoController::deduplicateLogo('XE.png', []);
LogoController::deduplicateLogo('XF.png', []);
LogoController::deduplicateLogo('XJ.png', ['thai-airasia-x-limited']);
LogoController::deduplicateLogo('XK.png', ['air-corsica']);
LogoController::deduplicateLogo('XL.png', []);
LogoController::deduplicateLogo('XM.png', ['zimex-aviation']);
LogoController::deduplicateLogo('XN.png', []);
LogoController::deduplicateLogo('XO.png', ['south-east-asian-airlines-seair-international']);
LogoController::deduplicateLogo('XP.png', []);
LogoController::deduplicateLogo('XT.png', []);
LogoController::deduplicateLogo('XY.png', ['national-air-dba-flynas']);
LogoController::deduplicateLogo('Y2.png', ['air-century']);
LogoController::deduplicateLogo('Y4.png', ['volaris']);
LogoController::deduplicateLogo('Y5.png', []);
LogoController::deduplicateLogo('Y6.png', ['ab-aviation']);
LogoController::deduplicateLogo('Y7.png', []);
LogoController::deduplicateLogo('YC.png', []);
LogoController::deduplicateLogo('YD.png', []);
LogoController::deduplicateLogo('YE.png', ['yanair']);
LogoController::deduplicateLogo('YI.png', []);
LogoController::deduplicateLogo('YK.png', ['avia-traffic']);
LogoController::deduplicateLogo('YP.png', []);
LogoController::deduplicateLogo('YQ.png', []);
LogoController::deduplicateLogo('YT.png', ['yeti-airlines']);
LogoController::deduplicateLogo('YU.png', ['euroatlantic-airways']);
LogoController::deduplicateLogo('YW.png', ['air-nostrum']);
LogoController::deduplicateLogo('Z2.png', []);
LogoController::deduplicateLogo('Z7.png', []);
LogoController::deduplicateLogo('ZA.png', ['sky-angkor-airlines']);
LogoController::deduplicateLogo('ZE.png', ['eastar-jet']);
LogoController::deduplicateLogo('ZF.png', ['azur-air-liability']);
LogoController::deduplicateLogo('ZG.png', []);
LogoController::deduplicateLogo('ZH.png', ['shenzhen-airlines']);
LogoController::deduplicateLogo('ZL.png', ['rex-regional-express']);
LogoController::deduplicateLogo('ZM.png', ['air-manas-dba-air-manas-air']);
LogoController::deduplicateLogo('ZN.png', []);
LogoController::deduplicateLogo('ZP.png', []);
LogoController::deduplicateLogo('ZQ.png', []);
LogoController::deduplicateLogo('ZT.png', ['titan-airways']);
LogoController::deduplicateLogo('ZV.png', []);
LogoController::deduplicateLogo('ZX.png', []);
LogoController::deduplicateLogo('ZY.png', []);
}
/**
* Reverse the migrations.
*/
public function down(): void
{
//
}
};
@@ -0,0 +1,271 @@
<?php
use App\Models\Airline;
use App\Models\Country;
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
public function createAirline(
string $name,
bool $active,
string $countryCode,
?string $iataCode = null,
?string $icaoCode = null,
?string $logo = null,
?string $internalName = null,
): self {
$country = Country::where('code', $countryCode)->firstOrFail();
$internalName = $internalName ?? $this->generateInternalName($name);
$logo = $logo ?? $iataCode . '.png';
Airline::create([
'IATA_code' => $iataCode,
'ICAO_code' => $icaoCode,
'name' => $name,
'internal_name' => $internalName,
'active' => $active,
'logo' => $logo,
'country_id' => $country->id,
]);
return $this;
}
private function generateInternalName(string $name): string
{
return preg_replace('/[^a-z0-9]+/', '-', strtolower($name));
}
public function up(): void
{
$this
->createAirline(name: 'Air Astra', active: true, countryCode: 'BD', iataCode: '2A', icaoCode: 'AWA') //✅
->createAirline(name: 'CMA CGM Air Cargo', active: true, countryCode: 'FR', iataCode: '2C', icaoCode: 'CMA') //✅
->createAirline(name: 'Eastern Airlines', active: true, countryCode: 'US', iataCode: '2D', icaoCode: 'EAL') //✅
->createAirline(name: 'Azul Conecta', active: true, countryCode: 'BR', iataCode: '2F', icaoCode: 'ACN') //✅
->createAirline(name: 'Maya Island Air', active: true, countryCode: 'BZ', iataCode: '2M', icaoCode: 'MYD') //✅
->createAirline(name: 'NG Eagle', active: true, countryCode: 'NG', iataCode: '2N', icaoCode: 'XLE') //✅
->createAirline(name: 'Sunlight Air', active: true, countryCode: 'PH', iataCode: '2R', icaoCode: 'RLB') //✅
->createAirline(name: 'Southwind Airlines', active: true, countryCode: 'TR', iataCode: '2S', icaoCode: 'STW') //✅
->createAirline(name: 'BermudAir', active: true, countryCode: 'BM', iataCode: '2T', icaoCode: 'BMA') //✅
->createAirline(name: 'World2Fly', active: true, countryCode: 'ES', iataCode: '2W', icaoCode: 'WFL') //✅
->createAirline(name: 'Air Chathams', active: true, countryCode: 'NZ', iataCode: '3C', icaoCode: 'CVA')//✅
->createAirline(name: 'Air Arabia Abu Dhabi', active: true, countryCode: 'AE', iataCode: '3L', icaoCode: 'ADY')//✅
->createAirline(name: 'World2Fly Portugal', active: true, countryCode: 'PT', iataCode: '3P', icaoCode: 'WPT')//✅
->createAirline(name: 'Divi Divi Air', active: true, countryCode: 'CW', iataCode: '3R', icaoCode: 'DVR')//✅
->createAirline(name: 'Smartwings Poland', active: true, countryCode: 'PL', iataCode: '3Z', icaoCode: 'TVP')//✅
->createAirline(name: 'Atsa Airways', active: true, countryCode: 'PE', iataCode: '4A', icaoCode: 'AMP')//✅
->createAirline(name: 'FlyYo', active: true, countryCode: 'RO', iataCode: '4D', icaoCode: 'DIR')//✅
->createAirline(name: 'Freedom Airlines Express', active: true, countryCode: 'KE', iataCode: '4F', icaoCode: 'FDT')//✅
->createAirline(name: 'Freedom Airlines Express Somalia', active: true, countryCode: 'SO', iataCode: '4K', icaoCode: 'SMK', internalName: 'freedom-airlines-express-somalia')//✅
->createAirline(name: 'Air Antilles', active: true, countryCode: 'GP', iataCode: '4I', icaoCode: 'KES')//✅
->createAirline(name: 'Mavi Gok Airlines', active: true, countryCode: 'TR', iataCode: '4M', icaoCode: 'MGH')//✅
->createAirline(name: 'Air Montenegro', active: true, countryCode: 'ME', iataCode: '4O', icaoCode: 'MNE')//✅
->createAirline(name: 'Red Sea Airlines', active: true, countryCode: 'EG', iataCode: '4S', icaoCode: 'RSX')//✅
->createAirline(name: 'Rise Air', active: true, countryCode: 'CA', iataCode: '4T', icaoCode: 'WEW')//✅
->createAirline(name: 'Discover Airlines', active: true, countryCode: 'DE', iataCode: '4Y', icaoCode: 'OCN')//✅
->createAirline(name: 'Lanexang Airways', active: true, countryCode: 'LA', iataCode: '5A', icaoCode: 'LXW')//✅
->createAirline(name: 'Aeromexico Connect', active: true, countryCode: 'MX', iataCode: '5D', icaoCode: 'SLI')//✅
->createAirline(name: 'Shirak Avia', active: true, countryCode: 'AM', iataCode: '5G', icaoCode: 'SHS')//✅
->createAirline(name: 'LIAT Air', active: true, countryCode: 'AG', iataCode: '5L', icaoCode: 'GAO')//✅
->createAirline(name: 'Smartavia', active: true, countryCode: 'RU', iataCode: '5N', icaoCode: 'AUL')//✅
->createAirline(name: 'Smartwings Slovakia', active: true, countryCode: 'SK', iataCode: '6D', icaoCode: 'TVQ')//✅
->createAirline(name: 'Air Anka', active: true, countryCode: 'TR', iataCode: '6K', icaoCode: 'TAH')//✅
->createAirline(name: 'CVSky', active: true, countryCode: 'CV', iataCode: '7B', icaoCode: 'KGF')//✅
->createAirline(name: 'Smartwings Hungary', active: true, countryCode: 'HU', iataCode: '7O', icaoCode: 'TVL')//✅
->createAirline(name: 'AeroDili', active: true, countryCode: 'TL', iataCode: '8G', icaoCode: 'DTL')//✅
->createAirline(name: 'Isles of Scilly Skybus', active: true, countryCode: 'GB', iataCode: '8Y', icaoCode: 'IOS')//✅
->createAirline(name: 'Congo Airways', active: true, countryCode: 'CD', iataCode: '8Z', icaoCode: 'CGA')//✅
->createAirline(name: 'Genghis Khan Airlines', active: true, countryCode: 'CN', iataCode: '9D', icaoCode: 'NMG')//✅
->createAirline(name: 'Sun PhuQuoc', active: true, countryCode: 'VN', iataCode: '9G', icaoCode: 'SPQ')//✅
->createAirline(name: 'Fly Jinnah', active: true, countryCode: 'PK', iataCode: '9P', icaoCode: 'FJL')//✅
->createAirline(name: 'SATENA', active: true, countryCode: 'CO', iataCode: '9R', icaoCode: 'NSE')//✅
->createAirline(name: 'Air Samarkand', active: true, countryCode: 'UZ', iataCode: '9S', icaoCode: 'UZS')//✅
->createAirline(name: 'AnimaWings', active: true, countryCode: 'RO', iataCode: 'A2', icaoCode: 'AWG')//✅
->createAirline(name: 'Azimuth Airlines', active: true, countryCode: 'RU', iataCode: 'A4', icaoCode: 'AZO')//✅
->createAirline(name: 'Air Travel', active: true, countryCode: 'CN', iataCode: 'A6', icaoCode: 'OTC')//✅
->createAirline(name: 'AeroLink Uganda', active: true, countryCode: 'UG', iataCode: 'A8', icaoCode: 'XAU')//✅
->createAirline(name: 'Aruba Airlines', active: true, countryCode: 'AW', iataCode: 'AG', icaoCode: 'ARU')//✅
->createAirline(name: 'Air Juan', active: true, countryCode: 'PH', iataCode: 'AO')//✅
->createAirline(name: 'ITA Airways', active: true, countryCode: 'IT', iataCode: 'AZ', icaoCode: 'ITY', logo: 'AZ_2.png')//✅
->createAirline(name: 'BeOND', active: true, countryCode: 'MV', iataCode: 'B4', icaoCode: 'BYD')//✅
->createAirline(name: 'TUI Airways', active: true, countryCode: 'GB', iataCode: 'BY', icaoCode: 'TOM')//✅
->createAirline(name: 'Uni Air', active: true, countryCode: 'TW', iataCode: 'B7', icaoCode: 'UIA')//✅
->createAirline(name: 'French Bee', active: true, countryCode: 'FR', iataCode: 'BF', icaoCode: 'FBU')//✅
->createAirline(name: 'Pacific Airlines', active: true, countryCode: 'VN', iataCode: 'BL', icaoCode: 'PIC')//✅
->createAirline(name: 'Medsky', active: true, countryCode: 'LY', iataCode: 'BM', icaoCode: 'MNS')//✅
->createAirline(name: 'SkyAlps', active: true, countryCode: 'IT', iataCode: 'BQ', icaoCode: 'SWU')//✅
->createAirline(name: 'Toki Air', active: true, countryCode: 'JP', iataCode: 'BV', icaoCode: 'TOK')//✅
->createAirline(name: 'Bluebird Airways', active: true, countryCode: 'GR', iataCode: 'BZ', icaoCode: 'BBG')//✅
->createAirline(name: 'Centrum Air', active: true, countryCode: 'UZ', iataCode: 'C6', icaoCode: 'MFX')
->createAirline(name: 'Air Belgium', active: false, countryCode: 'BE', iataCode: 'CB', icaoCode: 'ABB')
->createAirline(name: 'Chair Airlines', active: true, countryCode: 'CH', iataCode: 'CS', icaoCode: 'CSW')
->createAirline(name: 'Sunrise Dominicana', active: true, countryCode: 'DO', iataCode: 'D6', icaoCode: 'GCA')
->createAirline(name: 'Daallo Airlines', active: true, countryCode: 'SO', iataCode: 'D9', icaoCode: 'DMQ')
->createAirline(name: 'Cebgo', active: true, countryCode: 'PH', iataCode: 'DG', icaoCode: 'SRQ')
->createAirline(name: 'FlyAden', active: true, countryCode: 'YE', iataCode: 'DH', icaoCode: 'QFF')
->createAirline(name: 'Marabu', active: true, countryCode: 'EE', iataCode: 'DI', icaoCode: 'MBU')
->createAirline(name: 'Sunclass Airlines', active: true, countryCode: 'DK', iataCode: 'DK', icaoCode: 'VKG')
->createAirline(name: 'Arajet', active: true, countryCode: 'DO', iataCode: 'DM', icaoCode: 'DWI')
->createAirline(name: 'Dan Air', active: true, countryCode: 'RO', iataCode: 'DN', icaoCode: 'DNA')
->createAirline(name: 'Alexandria Airlines', active: true, countryCode: 'EG', iataCode: 'DQ', icaoCode: 'KHH')
->createAirline(name: 'Enter Air', active: true, countryCode: 'PL', iataCode: 'E4', icaoCode: 'ENT')
->createAirline(name: 'Iberojet', active: true, countryCode: 'ES', iataCode: 'E9', icaoCode: 'EVE')
->createAirline(name: 'EasyJet Europe', active: true, countryCode: 'AT', iataCode: 'EC', icaoCode: 'EJU')
->createAirline(name: 'ECAIR', active: true, countryCode: 'CG', iataCode: 'EJ', icaoCode: 'EQR')
->createAirline(name: 'Air Dolomiti', active: true, countryCode: 'IT', iataCode: 'EN', icaoCode: 'DLA')
->createAirline(name: 'Fly Angola', active: true, countryCode: 'AO', iataCode: 'EQ')
->createAirline(name: 'Serene Air', active: false, countryCode: 'PK', iataCode: 'ER', icaoCode: 'SEP')
->createAirline(name: 'Avianca Express', active: true, countryCode: 'CO', iataCode: 'EX', icaoCode: 'AVR')
->createAirline(name: 'Flyadeal', active: true, countryCode: 'SA', iataCode: 'F3', icaoCode: 'FAD')
->createAirline(name: 'I-Fly', active: true, countryCode: 'RU', iataCode: 'F7', icaoCode: 'RSY')
->createAirline(name: 'Link Airways', active: true, countryCode: 'AU', iataCode: 'FC', icaoCode: 'FCA')
->createAirline(name: '748 Air Services', active: true, countryCode: 'KE', iataCode: 'FE', icaoCode: 'IHO')
->createAirline(name: 'FlyBondi', active: true, countryCode: 'AR', iataCode: 'FO', icaoCode: 'FBZ')
->createAirline(name: 'FlyPelican', active: true, countryCode: 'AU', iataCode: 'FP', icaoCode: 'FRE')
->createAirline(name: 'FlyArystan', active: true, countryCode: 'KZ', iataCode: 'FS', icaoCode: 'AYN')
->createAirline(name: 'FlyTiwi', active: true, countryCode: 'AU', iataCode: 'FT')
->createAirline(name: 'Guyane Express Fly', active: true, countryCode: 'GF', iataCode: 'G8')
->createAirline(name: 'Nexus Airlines', active: true, countryCode: 'AU', iataCode: 'GD')
->createAirline(name: 'Avianca Guatemala', active: true, countryCode: 'GT', iataCode: 'GU', icaoCode: 'GUG')
->createAirline(name: 'Costa Rica Green Airways', active: true, countryCode: 'CR', iataCode: 'GW', icaoCode: 'CRG')
->createAirline(name: 'HiSky Romania', active: true, countryCode: 'RO', iataCode: 'H4', icaoCode: 'HYS')
->createAirline(name: 'CM Airlines', active: true, countryCode: 'HN', iataCode: 'H5', icaoCode: 'OMT')
->createAirline(name: 'Sky Airline Peru', active: true, countryCode: 'PE', iataCode: 'H8', icaoCode: 'SKX')
->createAirline(name: 'Air Senegal', active: true, countryCode: 'SN', iataCode: 'HC', icaoCode: 'SZN')
->createAirline(name: 'Qanot Sharq', active: true, countryCode: 'UZ', iataCode: 'HH', icaoCode: 'QNT')
->createAirline(name: 'Heston Airlines', active: true, countryCode: 'LT', iataCode: 'HN', icaoCode: 'HST')
->createAirline(name: 'Populair', active: true, countryCode: 'SE', iataCode: 'HP', icaoCode: 'APF')
->createAirline(name: 'IndiaOne Air', active: true, countryCode: 'IN', iataCode: 'I7', icaoCode: 'IOA')
->createAirline(name: 'Fly91', active: true, countryCode: 'IN', iataCode: 'IC', icaoCode: 'GOA')
->createAirline(name: 'Southern Sky Airlines', active: true, countryCode: 'KZ', iataCode: 'IH', icaoCode: 'SRS');
$this
->createAirline(name: 'Air Kiribati', active: true, countryCode: 'KI', iataCode: 'IK', icaoCode: 'AKL')
->createAirline(name: 'IrAero', active: true, countryCode: 'RU', iataCode: 'IO', icaoCode: 'IAE')
->createAirline(name: 'Vietjet Air Qazaqstan', active: true, countryCode: 'KZ', iataCode: 'IQ', icaoCode: 'QAZ')
->createAirline(name: 'Sepehran Airlines', active: true, countryCode: 'IR', iataCode: 'IS', icaoCode: 'SHI')
->createAirline(name: 'Super Air Jet', active: true, countryCode: 'ID', iataCode: 'IU', icaoCode: 'SJV')
->createAirline(name: 'Air India Express', active: true, countryCode: 'IN', iataCode: 'IX', icaoCode: 'AXB')
->createAirline(name: 'Buffalo Airways', active: true, countryCode: 'CA', iataCode: 'J0', icaoCode: 'BFL')
->createAirline(name: 'FlyGabon', active: true, countryCode: 'GA', iataCode: 'J7', icaoCode: 'ABS')
->createAirline(name: 'Armenian Airlines', active: true, countryCode: 'AM', iataCode: 'JI', icaoCode: 'AAG')
->createAirline(name: 'LATAM Brasil', active: true, countryCode: 'BR', iataCode: 'JJ', icaoCode: 'TAM')
->createAirline(name: 'Jambojet', active: true, countryCode: 'KE', iataCode: 'JM', icaoCode: 'JMA')
->createAirline(name: 'Starlux Airlines', active: true, countryCode: 'TW', iataCode: 'JX', icaoCode: 'SJX')
->createAirline(name: 'Mingalar', active: true, countryCode: 'MM', iataCode: 'K7', icaoCode: 'KBZ')
->createAirline(name: 'TezJet', active: true, countryCode: 'KG', iataCode: 'K9', icaoCode: 'TEZ')
->createAirline(name: 'Denver Air Connection', active: true, countryCode: 'US', iataCode: 'KG', icaoCode: 'LYM')
->createAirline(name: 'ASKY Airlines', active: true, countryCode: 'TG', iataCode: 'KP', icaoCode: 'SKK')
->createAirline(name: 'Cambodia Airways', active: true, countryCode: 'KH', iataCode: 'KR', icaoCode: 'KME')
->createAirline(name: 'FlyJaya', active: true, countryCode: 'ID', iataCode: 'KS', icaoCode: 'FHS')
->createAirline(name: 'LATAM', active: true, countryCode: 'CL', iataCode: 'LA', icaoCode: 'LAN', logo: 'LA_2.png')
->createAirline(name: 'Lulutai Airlines', active: true, countryCode: 'TO', iataCode: 'L8', icaoCode: 'TON')
->createAirline(name: 'Contour Airlines', active: true, countryCode: 'US', iataCode: 'LF', icaoCode: 'VTE')
->createAirline(name: 'Level', active: true, countryCode: 'ES', iataCode: 'LL', icaoCode: 'LVL')
->createAirline(name: 'Avianca Costa Rica', active: true, countryCode: 'CR', iataCode: 'LR', icaoCode: 'LRC')
->createAirline(name: 'LJ Air', active: true, countryCode: 'CN', iataCode: 'LT', icaoCode: 'SNG')
->createAirline(name: 'Lauda Europe', active: true, countryCode: 'MT', iataCode: 'LW', icaoCode: 'LDA')
->createAirline(name: 'Eznis Airways', active: false, countryCode: 'MN', iataCode: 'MG', icaoCode: 'EZA')
->createAirline(name: 'Myway Airlines', active: true, countryCode: 'GE', iataCode: 'MJ', icaoCode: 'MYW')
->createAirline(name: 'Air Mediterranean', active: true, countryCode: 'GR', iataCode: 'MV', icaoCode: 'MAR')
->createAirline(name: 'Malta Air', active: true, countryCode: 'MT', iataCode: 'MW', icaoCode: 'MAY')
->createAirline(name: 'Breeze Airways', active: true, countryCode: 'US', iataCode: 'MX', icaoCode: 'MXY')
->createAirline(name: 'AirBorneo', active: true, countryCode: 'MY', iataCode: 'MY', icaoCode: 'MWG')
->createAirline(name: 'Volaris El Salvador', active: true, countryCode: 'SV', iataCode: 'N3', icaoCode: 'VOS')
->createAirline(name: 'Shree Airlines', active: true, countryCode: 'NP', iataCode: 'N9', icaoCode: 'SHA')
->createAirline(name: 'Binani Air', active: true, countryCode: 'NG', iataCode: 'NA', icaoCode: 'BGL')
->createAirline(name: 'Berniq Airways', active: true, countryCode: 'LY', iataCode: 'NB', icaoCode: 'BNL')
->createAirline(name: 'TAP Express', active: true, countryCode: 'PT', iataCode: 'NI', icaoCode: 'PGA')
->createAirline(name: 'Air Moana', active: true, countryCode: 'PF', iataCode: 'NM', icaoCode: 'NTR')
->createAirline(name: 'Neos', active: true, countryCode: 'IT', iataCode: 'NO', icaoCode: 'NOS')
->createAirline(name: 'Air Japan', active: true, countryCode: 'JP', iataCode: 'NQ', icaoCode: 'AJX')
->createAirline(name: 'Manta Air', active: true, countryCode: 'MV', iataCode: 'NR', icaoCode: 'MAV')
->createAirline(name: 'Overland Airways', active: true, countryCode: 'NG', iataCode: 'OF', icaoCode: 'OLA')
->createAirline(name: 'Samoa Airways', active: true, countryCode: 'WS', iataCode: 'OL', icaoCode: 'PAO')
->createAirline(name: 'Passion Air', active: true, countryCode: 'GH', iataCode: 'OP', icaoCode: 'DIG')
->createAirline(name: 'SalamAir', active: true, countryCode: 'OM', iataCode: 'OV', icaoCode: 'OMS')
->createAirline(name: 'Skyward Airlines', active: true, countryCode: 'KE', iataCode: 'OW', icaoCode: 'SEW')
->createAirline(name: 'Air Peace', active: true, countryCode: 'NG', iataCode: 'P4', icaoCode: 'APK')
->createAirline(name: 'Wingo', active: true, countryCode: 'CO', iataCode: 'P5', icaoCode: 'RPB')
->createAirline(name: 'PAL Airlines', active: true, countryCode: 'CA', iataCode: 'PB', icaoCode: 'PVL')
->createAirline(name: "People's", active: true, countryCode: 'AT', iataCode: 'PE', icaoCode: 'PEV')
->createAirline(name: 'AirSial', active: true, countryCode: 'PK', iataCode: 'PF', icaoCode: 'SIF')
->createAirline(name: 'LATAM Paraguay', active: true, countryCode: 'PY', iataCode: 'PZ', icaoCode: 'LAP')
->createAirline(name: 'SkyUp Airlines', active: true, countryCode: 'UA', iataCode: 'PQ', icaoCode: 'SQP')
->createAirline(name: 'SkyUp MT', active: true, countryCode: 'MT', iataCode: 'U5', icaoCode: 'SEU')
->createAirline(name: 'St Barth Commuter', active: true, countryCode: 'BL', iataCode: 'PV', icaoCode: 'SBU')
->createAirline(name: 'Maldivian', active: true, countryCode: 'MV', iataCode: 'Q2', icaoCode: 'DQA')
->createAirline(name: 'Volaris Costa Rica', active: true, countryCode: 'CR', iataCode: 'Q6', icaoCode: 'VOC')
->createAirline(name: 'Green Africa Airways', active: true, countryCode: 'NG', iataCode: 'Q9', icaoCode: 'GWG')
->createAirline(name: 'Camair-Co', active: true, countryCode: 'CM', iataCode: 'QC', icaoCode: 'CRC')
->createAirline(name: 'Bamboo Airways', active: true, countryCode: 'VN', iataCode: 'QH', icaoCode: 'BAV')
->createAirline(name: 'Ibom Air', active: true, countryCode: 'NG', iataCode: 'QI', icaoCode: 'IAN')
->createAirline(name: 'Akasa Air', active: true, countryCode: 'IN', iataCode: 'QP', icaoCode: 'AKJ')
->createAirline(name: 'Yakutia Airlines', active: true, countryCode: 'RU', iataCode: 'R3', icaoCode: 'SYL')
->createAirline(name: 'Rano Air', active: true, countryCode: 'NG', iataCode: 'R4', icaoCode: 'RAN')
->createAirline(name: 'DAT', active: true, countryCode: 'LT', iataCode: 'R6', icaoCode: 'DNU')
->createAirline(name: 'SkyFru', active: true, countryCode: 'KG', iataCode: 'R8', icaoCode: 'KGZ')
->createAirline(name: 'Ryanair UK', active: true, countryCode: 'GB', iataCode: 'RK', icaoCode: 'RUK')
->createAirline(name: 'Eswatini Air', active: true, countryCode: 'SZ', iataCode: 'RN', icaoCode: 'SZL')
->createAirline(name: 'Buzz', active: true, countryCode: 'PL', iataCode: 'RR', icaoCode: 'RYS')
->createAirline(name: 'Air Seoul', active: true, countryCode: 'KR', iataCode: 'RS', icaoCode: 'ASV')
->createAirline(name: 'UVT Aero', active: true, countryCode: 'RU', iataCode: 'RT', icaoCode: 'UVT')
->createAirline(name: 'Riyadh Air', active: true, countryCode: 'SA', iataCode: 'RX', icaoCode: 'RXI')
->createAirline(name: 'Sunrise Airways', active: true, countryCode: 'HT', iataCode: 'S6', icaoCode: 'KSZ')
->createAirline(name: 'Domestic Airlines', active: true, countryCode: 'DZ', iataCode: 'SF', icaoCode: 'DTH')
->createAirline(name: 'Singapore Airlines', active: true, countryCode: 'SG', iataCode: 'SQ', icaoCode: 'SIA')
->createAirline(name: 'Sun Country Airlines', active: true, countryCode: 'US', iataCode: 'SY', icaoCode: 'SCX')
->createAirline(name: 'AirSWIFT', active: true, countryCode: 'PH', iataCode: 'T6', icaoCode: 'ATX')
->createAirline(name: 'Avianca El Salvador', active: true, countryCode: 'SV', iataCode: 'TA', icaoCode: 'TAI')
->createAirline(name: 'Airnorth', active: true, countryCode: 'AU', iataCode: 'TL', icaoCode: 'ANO')
->createAirline(name: 'FlyErbil', active: true, countryCode: 'IQ', iataCode: 'UD', icaoCode: 'UBD')
->createAirline(name: 'Uganda Airlines', active: true, countryCode: 'UG', iataCode: 'UR', icaoCode: 'UGD')
->createAirline(name: 'Umza Air', active: true, countryCode: 'NG', iataCode: 'UY', icaoCode: 'UMZ')
->createAirline(name: 'Aleutian Airways', active: true, countryCode: 'US', iataCode: 'VC', icaoCode: 'SRY')
->createAirline(name: 'Vieques Air Link', active: true, countryCode: 'PR', iataCode: 'VD', icaoCode: 'VES')
->createAirline(name: 'Clic Air', active: true, countryCode: 'CO', iataCode: 'VE', icaoCode: 'EFY')
->createAirline(name: 'Ajet', active: true, countryCode: 'TR', iataCode: 'VF', icaoCode: 'TKJ')
->createAirline(name: 'Valuejet', active: true, countryCode: 'NG', iataCode: 'VK', icaoCode: 'FVJ')
->createAirline(name: 'Lufthansa City Airlines', active: true, countryCode: 'DE', iataCode: 'VL', icaoCode: 'LHX')
->createAirline(name: 'Vietravel Airlines', active: true, countryCode: 'VN', iataCode: 'VU', icaoCode: 'VAG')
->createAirline(name: 'Pattaya Airways', active: true, countryCode: 'TH', iataCode: 'VV', icaoCode: 'PTW')
->createAirline(name: 'Wizz Air Malta', active: true, countryCode: 'MT', iataCode: 'W4', icaoCode: 'WMT')
->createAirline(name: 'Wizz Air UK', active: true, countryCode: 'GB', iataCode: 'W9', icaoCode: 'WUK')
->createAirline(name: 'Wingo Panama', active: true, countryCode: 'PA', iataCode: 'WH', icaoCode: 'WWP')
->createAirline(name: 'Wasaya Airways', active: true, countryCode: 'CA', iataCode: 'WP', icaoCode: 'WSG')
->createAirline(name: 'Western Air', active: true, countryCode: 'BS', iataCode: 'WU', icaoCode: 'WST')
->createAirline(name: 'FlyNamibia', active: true, countryCode: 'NA', iataCode: 'WV', icaoCode: 'FLN')
->createAirline(name: 'Venezolana', active: true, countryCode: 'VE', iataCode: 'WW', icaoCode: 'VNE');
$this
->createAirline(name: 'Air Europa Express', active: true, countryCode: 'ES', iataCode: 'X5', icaoCode: 'OVA')
->createAirline(name: 'JSX', active: true, countryCode: 'US', iataCode: 'XE', icaoCode: 'JSX')
->createAirline(name: 'Mexicana de Aviacion', active: true, countryCode: 'MX', iataCode: 'XN', icaoCode: 'MXA')
->createAirline(name: 'Avelo Airlines', active: true, countryCode: 'US', iataCode: 'XP', icaoCode: 'VXP')
->createAirline(name: 'AeroItalia', active: true, countryCode: 'IT', iataCode: 'XZ', icaoCode: 'AEZ')
->createAirline(name: 'Suparna Airlines', active: true, countryCode: 'CN', iataCode: 'Y8', icaoCode: 'YZR')
->createAirline(name: 'Harbour Air Seaplanes', active: true, countryCode: 'CA', iataCode: 'YB')
->createAirline(name: 'Yamal Airlines', active: true, countryCode: 'RU', iataCode: 'YC', icaoCode: 'LLM')
->createAirline(name: 'Fly OYA', active: true, countryCode: 'LY', iataCode: 'YI', icaoCode: 'OYA')
->createAirline(name: 'Air Premia', active: true, countryCode: 'KR', iataCode: 'YP', icaoCode: 'APZ')
->createAirline(name: 'TAR Aerolineas', active: true, countryCode: 'MX', iataCode: 'YQ', icaoCode: 'LCT')
->createAirline(name: 'FlightLink', active: true, countryCode: 'TZ', iataCode: 'YS', icaoCode: 'FLZ')
->createAirline(name: 'Philippines AirAsia', active: true, countryCode: 'PH', iataCode: 'Z2', icaoCode: 'APG')
->createAirline(name: 'ZIPAIR', active: true, countryCode: 'JP', iataCode: 'ZG', icaoCode: 'TZP')
->createAirline(name: 'Zambia Airways', active: true, countryCode: 'ZM', iataCode: 'ZN', icaoCode: 'AZB')
->createAirline(name: 'Paranair', active: true, countryCode: 'PY', iataCode: 'ZP', icaoCode: 'AZP')
->createAirline(name: 'Aerus', active: true, countryCode: 'MX', iataCode: 'ZV', icaoCode: 'RFD')
;
}
public function down(): void
{
}
};
@@ -0,0 +1,748 @@
<?php
use App\Models\Airline;
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Airline::where('internal_name', "748-air-services")->update(['name' => "748 Air Services"]);
Airline::where('internal_name', "ab-aviation")->update(['name' => "AB Aviation"]);
Airline::where('internal_name', "aegean-airlines")->update(['name' => "Aegean Airlines"]);
Airline::where('internal_name', "aer-lingus")->update(['name' => "Aer Lingus"]);
Airline::where('internal_name', "aerodili")->update(['name' => "AeroDili"]);
Airline::where('internal_name', "aeroflot")->update(['name' => "Aeroflot"]);
Airline::where('internal_name', "aeroitalia")->update(['name' => "AeroItalia"]);
Airline::where('internal_name', "aerolineas-argentinas")->update(['name' => "Aerolineas Argentinas"]);
Airline::where('internal_name', "aerogal")->update(['name' => "Avianca Ecuador"]);
Airline::where('internal_name', "aerolink-uganda")->update(['name' => "AeroLink Uganda"]);
Airline::where('internal_name', "aeromexico")->update(['name' => "Aeromexico"]);
Airline::where('internal_name', "aeromexico-connect")->update(['name' => "Aeromexico Connect"]);
Airline::where('internal_name', "aero-mongolia")->update(['name' => "Aero Mongolia"]);
Airline::where('internal_name', "aerotranscargo")->update(['name' => "Aerotranscargo"]);
Airline::where('internal_name', "aerus")->update(['name' => "Aerus"]);
Airline::where('internal_name', "africa-world-airlines")->update(['name' => "Africa World Airlines"]);
Airline::where('internal_name', "afriqiyah-airways")->update(['name' => "Afriqiyah Airways"]);
Airline::where('internal_name', "air-algerie")->update(['name' => "Air Algerie"]);
Airline::where('internal_name', "air-anka")->update(['name' => "Air Anka"]);
Airline::where('internal_name', "air-antilles")->update(['name' => "Air Antilles"]);
Airline::where('internal_name', "air-arabia")->update(['name' => "Air Arabia"]);
Airline::where('internal_name', "air-arabia-abu-dhabi")->update(['name' => "Air Arabia Abu Dhabi"]);
Airline::where('internal_name', "air-arabia-egypt")->update(['name' => "Air Arabia Egypt"]);
Airline::where('internal_name', "air-arabia-maroc")->update(['name' => "Air Arabia Maroc"]);
Airline::where('internal_name', "airasia-berhad-dba-airasia")->update(['name' => "AirAsia"]);
Airline::where('internal_name', "airasia-indonesia")->update(['name' => "AirAsia Indonesia"]);
Airline::where('internal_name', "airasia-x-berhad-dba-airasia-x")->update(['name' => "Air Asia X"]);
Airline::where('internal_name', "airasia-x-malaysia")->delete();
Airline::where('internal_name', "air-astana")->update(['name' => "Air Astana"]);
Airline::where('internal_name', "air-astra")->update(['name' => "Air Astra"]);
Airline::where('internal_name', "air-austral")->update(['name' => "Air Austral"]);
Airline::where('internal_name', "air-baltic")->update(['name' => "Air Baltic"]);
Airline::where('internal_name', "air-belgium")->update(['name' => "Air Belgium"]);
Airline::where('internal_name', "airblue")->update(['name' => "Airblue"]);
Airline::where('internal_name', "airborneo")->update(['name' => "AirBorneo"]);
Airline::where('internal_name', "air-botswana")->update(['name' => "Air Botswana"]);
Airline::where('internal_name', "air-burkina")->update(['name' => "Air Burkina"]);
Airline::where('internal_name', "air-busan")->update(['name' => "Air Busan"]);
Airline::where('internal_name', "air-cairo")->update(['name' => "Air Cairo"]);
Airline::where('internal_name', "air-caledonie")->update(['name' => "Air Caledonie"]);
Airline::where('internal_name', "aircalin")->update(['name' => "Aircalin"]);
Airline::where('internal_name', "air-canada")->update(['name' => "Air Canada"]);
Airline::where('internal_name', "air-canada-rouge")->update(['name' => "Air Canada Rouge"]);
Airline::where('internal_name', "air-caraibes")->update(['name' => "Air Caraibes"]);
Airline::where('internal_name', "air-century")->update(['name' => "Air Century."]);
Airline::where('internal_name', "air-chathams")->update(['name' => "Air Chathams"]);
Airline::where('internal_name', "air-china")->update(['name' => "Air China"]);
Airline::where('internal_name', "air-corsica")->update(['name' => "Air Corsica"]);
Airline::where('internal_name', "air-cote-d-ivoire")->update(['name' => "Air Cote D'Ivoire"]);
Airline::where('internal_name', "air-creebec-1994")->update(['name' => "Air Creebec"]);
Airline::where('internal_name', "air-do")->update(['name' => "Air Do"]);
Airline::where('internal_name', "air-dolomiti")->update(['name' => "Air Dolomiti"]);
Airline::where('internal_name', "air-europa")->update(['name' => "Air Europa"]);
Airline::where('internal_name', "air-europa-express")->update(['name' => "Air Europa Express"]);
Airline::where('internal_name', "airexplore")->update(['name' => "AirExplore"]);
Airline::where('internal_name', "air-france")->update(['name' => "Air France"]);
Airline::where('internal_name', "air-greenland-a-s")->update(['name' => "Air Greenland"]);
Airline::where('internal_name', "air-guilin")->update(['name' => "Air Guilin"]);
Airline::where('internal_name', "air-india")->update(['name' => "Air India"]);
Airline::where('internal_name', "air-india-express")->update(['name' => "Air India Express"]);
Airline::where('internal_name', "air-inuit-ltd-ltee")->update(['name' => "Air Inuit"]);
Airline::where('internal_name', "air-japan")->update(['name' => "Air Japan"]);
Airline::where('internal_name', "air-juan")->update(['name' => "Air Juan"]);
Airline::where('internal_name', "airkenya-express")->update(['name' => "AirKenya Express"]);
Airline::where('internal_name', "air-kiribati")->update(['name' => "Air Kiribati"]);
Airline::where('internal_name', "air-koryo")->update(['name' => "Air Koryo"]);
Airline::where('internal_name', "airline-allied-limited-dba-alliance-air")->update(['name' => "Alliance Air"]);
Airline::where('internal_name', "airlines-of-papua-new-guinea")->update(['name' => "PNG Air"]);
Airline::where('internal_name', "airlink")->update(['name' => "Airlink"]);
Airline::where('internal_name', "air-macau")->update(['name' => "Air Macau"]);
Airline::where('internal_name', "air-madagascar")->update(['name' => "Air Madagascar"]);
Airline::where('internal_name', "air-malta")->update(['name' => "Air Malta"]);
Airline::where('internal_name', "air-manas-dba-air-manas-air")->update(['name' => "Air Manas"]);
Airline::where('internal_name', "air-mauritius")->update(['name' => "Air Mauritius"]);
Airline::where('internal_name', "air-mediterranean")->update(['name' => "Air Mediterranean"]);
Airline::where('internal_name', "air-moana")->update(['name' => "Air Moana"]);
Airline::where('internal_name', "air-montenegro")->update(['name' => "Air Montenegro"]);
Airline::where('internal_name', "air-new-zealand")->update(['name' => "Air New Zealand"]);
Airline::where('internal_name', "air-niugini")->update(['name' => "Air Niugini"]);
Airline::where('internal_name', "airnorth")->update(['name' => "Airnorth"]);
Airline::where('internal_name', "air-north-charter-and-training")->update(['name' => "Air North"]);
Airline::where('internal_name', "air-nostrum")->update(['name' => "Air Nostrum"]);
Airline::where('internal_name', "air-panama-dba-parsa")->update(['name' => "Air Panama"]);
Airline::where('internal_name', "air-peace")->update(['name' => "Air Peace"]);
Airline::where('internal_name', "air-philippines-corporation-dba-pal-express-and-airphil-express")->update(['name' => "PAL Express"]);
Airline::where('internal_name', "air-premia")->update(['name' => "Air Premia"]);
Airline::where('internal_name', "air-rarotonga")->update(['name' => "Air Rarotonga"]);
Airline::where('internal_name', "air-saint-pierre")->update(['name' => "Air Saint-Pierre"]);
Airline::where('internal_name', "air-samarkand")->update(['name' => "Air Samarkand"]);
Airline::where('internal_name', "air-senegal")->update(['name' => "Air Senegal"]);
Airline::where('internal_name', "air-seoul")->update(['name' => "Air Seoul"]);
Airline::where('internal_name', "air-serbia-a-d-beograd")->update(['name' => "AirSERBIA"]);
Airline::where('internal_name', "air-seychelles")->update(['name' => "Air Seychelles"]);
Airline::where('internal_name', "airsial")->update(['name' => "AirSial"]);
Airline::where('internal_name', "airswift")->update(['name' => "AirSWIFT"]);
Airline::where('internal_name', "air-tahiti")->update(['name' => "Air Tahiti"]);
Airline::where('internal_name', "air-tahiti-nui")->update(['name' => "Air Tahiti Nui"]);
Airline::where('internal_name', "air-tanzania-ltd")->update(['name' => "Air Tanzania"]);
Airline::where('internal_name', "air-tindi-8t")->update(['name' => "Air Tindi"]);
Airline::where('internal_name', "air-transat")->update(['name' => "Air Transat"]);
Airline::where('internal_name', "air-travel")->update(['name' => "Air Travel"]);
Airline::where('internal_name', "air-urga")->update(['name' => "Air Urga"]);
Airline::where('internal_name', "air-vanuatu-operations")->update(['name' => "Air Vanuatu"]);
Airline::where('internal_name', "air-wisconsin-airlines-corporation-awac")->update(['name' => "Air Wisconsin"]);
Airline::where('internal_name', "air-zimbabwe-pvt")->update(['name' => "Air Zimbabwe "]);
Airline::where('internal_name', "ajet")->update(['name' => "AJet"]);
Airline::where('internal_name', "akasa-air")->update(['name' => "Akasa Air"]);
Airline::where('internal_name', "aklak")->update(['name' => "Aklak Air"]);
Airline::where('internal_name', "alaska-airlines")->update(['name' => "Alaska Airlines"]);
Airline::where('internal_name', "alaska-seaplane")->update(['name' => "Alaska Seaplane Service"]);
Airline::where('internal_name', "alaska-seaplane-j5")->delete();
Airline::where('internal_name', "aleutian-airways")->update(['name' => "Aleutian Airways"]);
Airline::where('internal_name', "alexandria-airlines")->update(['name' => "Alexandria Airlines"]);
Airline::where('internal_name', "alitalia")->update(['name' => "Alitalia"]);
Airline::where('internal_name', "allegiant-air")->update(['name' => "Allegiant Air LLC"]);
Airline::where('internal_name', "alliance-airlines")->update(['name' => "Alliance Airlines"]);
Airline::where('internal_name', "all-nippon-airways")->update(['name' => "All Nippon Airways"]);
Airline::where('internal_name', "alrosa-air")->update(['name' => "Alrosa Air"]);
Airline::where('internal_name', "alrosa-mirny-air-enterprise")->delete();
Airline::where('internal_name', "alsa-grupo-slu")->delete();
Airline::where('internal_name', "amakusa-airlines")->update(['name' => "Amakusa Airlines"]);
Airline::where('internal_name', "american-airlines")->update(['name' => "American Airlines"]);
Airline::where('internal_name', "ana-wings")->update(['name' => "ANA Wings"]);
Airline::where('internal_name', "anguilla-air")->update(['name' => "Anguilla Air Services"]);
Airline::where('internal_name', "animawings")->update(['name' => "AnimaWings"]);
Airline::where('internal_name', "arajet")->update(['name' => "Arajet"]);
Airline::where('internal_name', "ariana-afghan-airlines")->update(['name' => "Ariana Afghan Airlines"]);
Airline::where('internal_name', "arik-air")->update(['name' => "Arik Air"]);
Airline::where('internal_name', "arkia-israeli-airlines")->update(['name' => "Arkia"]);
Airline::where('internal_name', "armenia-airways-aircompany-cjsc")->update(['name' => "Armenia Airways"]);
Airline::where('internal_name', "armenian-airlines")->update(['name' => "Armenian Airlines"]);
Airline::where('internal_name', "aruba-airlines")->update(['name' => "Aruba Airlines"]);
Airline::where('internal_name', "asiana")->update(['name' => "Asiana"]);
Airline::where('internal_name', "asky-airlines")->update(['name' => "ASKY Airlines"]);
Airline::where('internal_name', "atlantic-airways")->update(['name' => "Atlantic Airways"]);
Airline::where('internal_name', "atlas-air")->update(['name' => "Atlas Air"]);
Airline::where('internal_name', "atsa-airways")->update(['name' => "Atsa Airways"]);
Airline::where('internal_name', "auric-air-limited")->update(['name' => "Auric Air"]);
Airline::where('internal_name', "aurigny-air-limited")->update(['name' => "Aurigny"]);
Airline::where('internal_name', "austrian")->update(['name' => "Austrian"]);
Airline::where('internal_name', "avelo-airlines")->update(['name' => "Avelo Airlines"]);
Airline::where('internal_name', "avianca")->update(['name' => "AVIANCA"]);
Airline::where('internal_name', "avianca-costa-rica")->update(['name' => "Avianca Costa Rica"]);
Airline::where('internal_name', "avianca-el-salvador")->update(['name' => "Avianca El Salvador"]);
Airline::where('internal_name', "avianca-express")->update(['name' => "Avianca Express"]);
Airline::where('internal_name', "avianca-guatemala")->update(['name' => "Avianca Guatemala"]);
Airline::where('internal_name', "avia-traffic")->update(['name' => "Avia Traffic Company"]);
Airline::where('internal_name', "c-a")->update(['name' => "Avior Airlines"]);
Airline::where('internal_name', "azerbaijan-airlines")->update(['name' => "Azerbaijan Airlines"]);
Airline::where('internal_name', "azimuth-airlines")->update(['name' => "Azimuth Airlines"]);
Airline::where('internal_name', "aztec-worldwide-airlines")->update(['name' => "Aztec Airways"]);
Airline::where('internal_name', "azul-brazilian-airlines")->update(['name' => "Azul Brazilian Airlines"]);
Airline::where('internal_name', "azul-conecta")->update(['name' => "Azul Conecta"]);
Airline::where('internal_name', "azur-air-liability")->update(['name' => "Azure Air"]);
Airline::where('internal_name', "ba-cityflyer")->update(['name' => "BA CityFlyer"]);
Airline::where('internal_name', "badr-airlines")->update(['name' => "Badr Airlines"]);
Airline::where('internal_name', "bahamasair")->update(['name' => "Bahamasair"]);
Airline::where('internal_name', "bamboo-airways")->update(['name' => "Bamboo Airways"]);
Airline::where('internal_name', "bangkok-air")->update(['name' => "Bangkok Air"]);
Airline::where('internal_name', "bearskin-lake-air-lp")->update(['name' => "Bearskin Airlines"]);
Airline::where('internal_name', "belavia-belarusian-airlines")->update(['name' => "Belavia"]);
Airline::where('internal_name', "beond")->update(['name' => "BeOND"]);
Airline::where('internal_name', "bering-air")->update(['name' => "Bering Air"]);
Airline::where('internal_name', "berjaya-air-sdn-bhd")->update(['name' => "Berjaya Air"]);
Airline::where('internal_name', "bermudair")->update(['name' => "BermudAir"]);
Airline::where('internal_name', "berniq-airways")->update(['name' => "Berniq Airways"]);
Airline::where('internal_name', "bh-air")->update(['name' => "BH AIR"]);
Airline::where('internal_name', "bhutan-airlines")->update(['name' => "Bhutan Airlines"]);
Airline::where('internal_name', "biman")->update(['name' => "Biman"]);
Airline::where('internal_name', "binani-air")->update(['name' => "Binani Air"]);
Airline::where('internal_name', "binter-canarias")->update(['name' => "Binter Canarias"]);
Airline::where('internal_name', "bluebird-airways")->update(['name' => "Bluebird Airways"]);
Airline::where('internal_name', "boliviana-de-aviacion-boa")->update(['name' => "Boliviana de Aviacion"]);
Airline::where('internal_name', "bonza")->update(['name' => "Bonza"]);
Airline::where('internal_name', "boutique-air")->update(['name' => "Boutique Air"]);
Airline::where('internal_name', "braathens-regional-aviation-ab")->update(['name' => "Braathens Regional Airlines"]);
Airline::where('internal_name', "breeze-airways")->update(['name' => "Breeze Airways"]);
Airline::where('internal_name', "british-airways")->update(['name' => "British Airways"]);
Airline::where('internal_name', "brussels-airlines")->update(['name' => "Brussels Airlines"]);
Airline::where('internal_name', "buddha-air")->update(['name' => "Buddha Air"]);
Airline::where('internal_name', "buffalo-airways")->update(['name' => "Buffalo Airways"]);
Airline::where('internal_name', "bulgaria-air")->update(['name' => "Bulgaria Air"]);
Airline::where('internal_name', "bulgarian-air-charter")->update(['name' => "European Air Charter"]);
Airline::where('internal_name', "buraq-air")->update(['name' => "Buraq Air"]);
Airline::where('internal_name', "buzz")->update(['name' => "Buzz"]);
Airline::where('internal_name', "caicos-express-airways")->update(['name' => "Caicos Express Airways"]);
Airline::where('internal_name', "calm-air-international")->update(['name' => "Calm Air"]);
Airline::where('internal_name', "camair-co")->update(['name' => "Camair-Co"]);
Airline::where('internal_name', "cambodia-airways")->update(['name' => "Cambodia Airways"]);
Airline::where('internal_name', "cambodia-angkor-air-t-a-cambodia-angkor-air")->update(['name' => "Air Cambodia"]);
Airline::where('internal_name', "canadian-north")->update(['name' => "Canadian North"]);
Airline::where('internal_name', "canary-fly")->update(['name' => "Canary Fly"]);
Airline::where('internal_name', "cape-air")->update(['name' => "Cape Air"]);
Airline::where('internal_name', "beijing-capital-airlines")->update(['name' => "Capital Airlines"]);
Airline::where('internal_name', "cargojet-airways")->update(['name' => "Cargojet Airways"]);
Airline::where('internal_name', "cargolux-italia-s-p-a")->update(['name' => "Cargolux Italia"]);
Airline::where('internal_name', "cargolux-s-a")->update(['name' => "Cargolux"]);
Airline::where('internal_name', "caribbean-airlines")->update(['name' => "Caribbean Airlines"]);
Airline::where('internal_name', "carpatair")->update(['name' => "Carpatair"]);
Airline::where('internal_name', "cathay-pacific")->update(['name' => "Cathay Pacific"]);
Airline::where('internal_name', "cayman-airways")->update(['name' => "Cayman Airways"]);
Airline::where('internal_name', "cebgo")->update(['name' => "Cebgo"]);
Airline::where('internal_name', "cebu-pacific-air")->update(['name' => "Cebu Pacific"]);
Airline::where('internal_name', "cemair")->update(['name' => "Cemair"]);
Airline::where('internal_name', "centrum-air")->update(['name' => "Centrum Air"]);
Airline::where('internal_name', "chair-airlines")->update(['name' => "Chair Airlines"]);
Airline::where('internal_name', "chalair-aviation")->update(['name' => "Chalair Aviation"]);
Airline::where('internal_name', "commutair")->update(['name' => "CommuteAir"]);
Airline::where('internal_name', "chang-an-airlines")->update(['name' => "Air Changan"]);
Airline::where('internal_name', "chengdu-airlines")->update(['name' => "Chengdu Airlines"]);
Airline::where('internal_name', "china-airlines")->update(['name' => "China Airlines"]);
Airline::where('internal_name', "china-eastern")->update(['name' => "China Eastern"]);
Airline::where('internal_name', "china-express-airlines")->update(['name' => "China Express Airlines"]);
Airline::where('internal_name', "china-postal-airlines")->update(['name' => "China Postal Airlines"]);
Airline::where('internal_name', "china-southern-airlines")->update(['name' => "China Southern Airlines"]);
Airline::where('internal_name', "china-west-air")->update(['name' => "China West Air"]);
Airline::where('internal_name', "chongqing-airlines")->update(['name' => "Chongqing Airlines"]);
Airline::where('internal_name', "cinnamon-air")->update(['name' => "Cinnamon Air"]);
Airline::where('internal_name', "clic-air")->update(['name' => "Clic Air"]);
Airline::where('internal_name', "cma-cgm-air-cargo")->update(['name' => "CMA CGM Air Cargo"]);
Airline::where('internal_name', "cm-airlines")->update(['name' => "CM Airlines"]);
Airline::where('internal_name', "coastal-aviation")->update(['name' => "Coastal Air"]);
Airline::where('internal_name', "coastal-travels-cq")->delete();
Airline::where('internal_name', "colorful-guizhou-airlines")->update(['name' => "Colorful Guizhou Airlines"]);
Airline::where('internal_name', "compagnie-africaine-d-aviation-caa")->update(['name' => "Compagnie Africaine d'Aviation"]);
Airline::where('internal_name', "compania-operadora-de-corto-y-medio-radio-iberia-express")->update(['name' => "Iberia Express"]);
Airline::where('internal_name', "condor")->update(['name' => "Condor"]);
Airline::where('internal_name', "congo-airways")->update(['name' => "Congo Airways"]);
Airline::where('internal_name', "continental-airlines")->update(['name' => "Continental Airlines"]);
Airline::where('internal_name', "contour-airlines")->update(['name' => "Contour Airlines"]);
Airline::where('internal_name', "conviasa")->update(['name' => "Conviasa"]);
Airline::where('internal_name', "copa-airlines")->update(['name' => "COPA Airlines"]);
Airline::where('internal_name', "corendon-airlines")->update(['name' => "Corendon Airlines"]);
Airline::where('internal_name', "corendon-dutch-airlines-b-v")->update(['name' => "Corendon Dutch Airlines"]);
Airline::where('internal_name', "corsair")->update(['name' => "Corsair International"]);
Airline::where('internal_name', "costa-rica-green-airways")->update(['name' => "Costa Rica Green Airways"]);
Airline::where('internal_name', "croatia-airlines")->update(['name' => "Croatia Airlines"]);
Airline::where('internal_name', "cubana")->update(['name' => "Cubana"]);
Airline::where('internal_name', "cvsky")->update(['name' => "CVSky"]);
Airline::where('internal_name', "cyprus-airways")->update(['name' => "Cyprus Airways"]);
Airline::where('id', 650)->update(['name' => "Daallo Airlines"]);
Airline::where('id', 13199)->update(['name' => "Daallo Airlines Somalia", 'internal_name' => 'daallo-airlines-somalia']);
Airline::where('internal_name', "dan-air")->update(['name' => "Dan Air"]);
Airline::where('internal_name', "danish-air-transport")->update(['name' => "DAT"]);
Airline::where('internal_name', "dat")->update(['name' => "DAT LT"]);
Airline::where('internal_name', "delta-air-lines")->update(['name' => "Delta"]);
Airline::where('internal_name', "denver-air-connection")->update(['name' => "Denver Air Connection"]);
Airline::where('internal_name', "dhl-aero-expreso-s-a")->update(['name' => "DHL Aero Expreso"]);
Airline::where('internal_name', "dhl-air")->update(['name' => "DHL Air"]);
Airline::where('internal_name', "dhl-de-guatemala-s-a")->update(['name' => "DHL de Guatemala"]);
Airline::where('internal_name', "discover-airlines")->update(['name' => "Discover Airlines"]);
Airline::where('internal_name', "divi-divi-air")->update(['name' => "Divi Divi Air"]);
Airline::where('internal_name', "domestic-airlines")->update(['name' => "Domestic Airlines"]);
Airline::where('internal_name', "donghai-airlines")->update(['name' => "Donghai Airlines"]);
Airline::where('internal_name', "dreamjet-sas-t-a-la-compagnie")->update(['name' => "La Compagnie"]);
Airline::where('internal_name', "druk-air-corporation")->update(['name' => "Druk Air"]);
Airline::where('internal_name', "eastar-jet")->update(['name' => "Eastar Jet "]);
Airline::where('internal_name', "eastern-airlines")->update(['name' => "Eastern Airlines"]);
Airline::where('internal_name', "easyjet")->update(['name' => "EasyJet"]);
Airline::where('internal_name', "easyjet-europe")->update(['name' => "EasyJet Europe"]);
Airline::where('internal_name', "easyjet-switzerland-s-a")->update(['name' => "EasyJet Switzerland"]);
Airline::where('internal_name', "ecair")->update(['name' => "ECAIR"]);
Airline::where('internal_name', "edelweiss-air")->update(['name' => "Edelweiss Air"]);
Airline::where('internal_name', "egyptair")->update(['name' => "Egyptair"]);
Airline::where('internal_name', "el-al-israel-airlines")->update(['name' => "EL AL"]);
Airline::where('internal_name', "emirates")->update(['name' => "Emirates"]);
Airline::where('internal_name', "endeavor-air")->update(['name' => "Endeavor Air"]);
Airline::where('internal_name', "enter-air")->update(['name' => "Enter Air"]);
Airline::where('internal_name', "envoy-air")->update(['name' => "Envoy Air Inc."]);
Airline::where('internal_name', "eswatini-air")->update(['name' => "Eswatini Air"]);
Airline::where('internal_name', "ethiopian-airlines")->update(['name' => "Ethiopian Airlines"]);
Airline::where('internal_name', "etihad-airways")->update(['name' => "Etihad Airways"]);
Airline::where('internal_name', "euroatlantic-airways")->update(['name' => "Euroatlantic Airways"]);
Airline::where('internal_name', "eurowings")->update(['name' => "Eurowings"]);
Airline::where('internal_name', "eurowings-europe-gmbh")->update(['name' => "Eurowings Europe"]);
Airline::where('internal_name', "eva-air")->update(['name' => "EVA Air"]);
Airline::where('internal_name', "ewa-air")->update(['name' => "EWA Air"]);
Airline::where('internal_name', "eznis-airways")->update(['name' => "Eznis Airways"]);
Airline::where('internal_name', "fai-rent-a-jet")->delete();
Airline::where('internal_name', "faso-airways")->delete();
Airline::where('internal_name', "fastjet-airlines")->update(['name' => "fastjet"]);
Airline::where('internal_name', "federal-air")->update(['name' => "Federal Air"]);
Airline::where('internal_name', "federal-express")->update(['name' => "Federal Express"]);
Airline::where('internal_name', "air-pacific")->update(['name' => "Fiji Airways"]);
Airline::where('internal_name', "finnair")->update(['name' => "Finnair"]);
Airline::where('internal_name', "fitsair")->update(['name' => "FitsAir"]);
Airline::where('internal_name', "flair-airlines")->update(['name' => "Flair Airlines"]);
Airline::where('internal_name', "flexflight-aps")->update(['name' => "FlexFlight"]);
Airline::where('internal_name', "flightlink")->update(['name' => "FlightLink"]);
Airline::where('internal_name', "fly91")->update(['name' => "Fly91"]);
Airline::where('internal_name', "flyadeal")->update(['name' => "Flyadeal"]);
Airline::where('internal_name', "flyaden")->update(['name' => "FlyAden"]);
Airline::where('internal_name', "fly-all-ways")->update(['name' => "Fly All Ways"]);
Airline::where('internal_name', "fly-always-n-v")->delete();
Airline::where('internal_name', "fly-angola")->update(['name' => "Fly Angola"]);
Airline::where('internal_name', "flyarystan")->update(['name' => "FlyArystan"]);
Airline::where('internal_name', "flybondi")->update(['name' => "FlyBondi"]);
Airline::where('internal_name', "flydubai")->update(['name' => "flydubai"]);
Airline::where('internal_name', "flyerbil")->update(['name' => "FlyErbil"]);
Airline::where('internal_name', "flyexcellent")->delete();
Airline::where('internal_name', "flyfirefly-sdn-bhd")->update(['name' => "Firefly"]);
Airline::where('internal_name', "flygabon")->update(['name' => "FlyGabon"]);
Airline::where('internal_name', "flyjaya")->update(['name' => "FlyJaya"]);
Airline::where('internal_name', "fly-jinnah")->update(['name' => "Fly Jinnah"]);
Airline::where('internal_name', "flynamibia")->update(['name' => "FlyNamibia"]);
Airline::where('internal_name', "fly-one-s-r-l")->update(['name' => "Fly One"]);
Airline::where('internal_name', "fly-oya")->update(['name' => "Fly OYA"]);
Airline::where('internal_name', "flypelican")->update(['name' => "FlyPelican"]);
Airline::where('internal_name', "flytiwi")->update(['name' => "FlyTiwi"]);
Airline::where('internal_name', "flyyo")->update(['name' => "FlyYo"]);
Airline::where('internal_name', "freebird-airlines")->update(['name' => "Freebird Airlines"]);
Airline::where('internal_name', "freedom-airlines-express")->update(['name' => "Freedom Airlines Express"]);
Airline::where('internal_name', "freedom-airlines-express-somalia")->update(['name' => "Freedom Airlines Express Somalia"]);
Airline::where('internal_name', "french-bee")->update(['name' => "French Bee"]);
Airline::where('internal_name', "frontier")->update(['name' => "Frontier"]);
Airline::where('internal_name', "frontier-airlines")->delete();
Airline::where('internal_name', "fuji-dream-airlines")->update(['name' => "Fuji Dream Airlines"]);
Airline::where('internal_name', "fuzhou-airlines")->update(['name' => "Fuzhou Airlines"]);
Airline::where('internal_name', "garuda")->update(['name' => "Garuda Indonesia"]);
Airline::where('internal_name', "gazpromavia-aviation-ltd")->update(['name' => "Gazpromavia"]);
Airline::where('internal_name', "genghis-khan-airlines")->update(['name' => "Genghis Khan Airlines"]);
Airline::where('internal_name', "georgian-airways")->update(['name' => "Georgian Airways"]);
Airline::where('internal_name', "gol-airlines")->update(['name' => "GOL Airlines"]);
Airline::where('internal_name', "grand-canyon-airlines")->update(['name' => "Grand Canyon Scenic Airlines"]);
Airline::where('internal_name', "grand-china-air")->update(['name' => "Grand China Air"]);
Airline::where('internal_name', "green-africa-airways")->update(['name' => "Green Africa Airways"]);
Airline::where('internal_name', "guangxi-beibu-gulf-airlines")->update(['name' => "GX Airlines"]);
Airline::where('internal_name', "gulf-air")->update(['name' => "Gulf Air"]);
Airline::where('internal_name', "guyane-express-fly")->update(['name' => "Guyane Express Fly"]);
Airline::where('internal_name', "hahn-air")->update(['name' => "Hahn Air"]);
Airline::where('internal_name', "hahn-air-systems")->update(['name' => "Hahn Air Systems"]);
Airline::where('internal_name', "hainan-airlines")->update(['name' => "Hainan Airlines"]);
Airline::where('internal_name', "harbour-air-seaplanes")->update(['name' => "Harbour Air Seaplanes"]);
Airline::where('internal_name', "hawaiian-airlines")->update(['name' => "Hawaiian Airlines"]);
Airline::where('internal_name', "hebei-airlines")->update(['name' => "Hebei Airlines"]);
Airline::where('internal_name', "helvetic-airways-ag")->update(['name' => "Helvetic Airways"]);
Airline::where('internal_name', "heston-airlines")->update(['name' => "Heston Airlines"]);
Airline::where('internal_name', "himalaya-airlines-pvt")->update(['name' => "Himalaya Airlines"]);
Airline::where('internal_name', "hinterland-aviation-pty")->update(['name' => "Hinterland Aviation"]);
Airline::where('internal_name', "hisky-romania")->update(['name' => "HiSky Romania"]);
Airline::where('internal_name', "hong-kong-airlines")->update(['name' => "Hong Kong Airlines"]);
Airline::where('internal_name', "hong-kong-express-airways")->update(['name' => "Hong Kong Express Airways"]);
Airline::where('internal_name', "hop")->update(['name' => "HOP!"]);
Airline::where('internal_name', "horizon-air-industries")->update(['name' => "Horizon Air"]);
Airline::where('internal_name', "hunnu-air")->update(['name' => "Hunnu Air"]);
Airline::where('internal_name', "iberia")->update(['name' => "Iberia"]);
Airline::where('internal_name', "iberojet")->update(['name' => "Iberojet"]);
Airline::where('internal_name', "ibex-airlines")->update(['name' => "Ibex Airlines"]);
Airline::where('internal_name', "ibom-air")->update(['name' => "Ibom Air"]);
Airline::where('internal_name', "icelandair")->update(['name' => "Icelandair"]);
Airline::where('internal_name', "i-fly")->update(['name' => "I-Fly"]);
Airline::where('internal_name', "indiaone-air")->update(['name' => "IndiaOne Air"]);
Airline::where('internal_name', "inselair")->update(['name' => "InselAir"]);
Airline::where('internal_name', "intercaribbean-airways")->update(['name' => "InterCaribbean Airways"]);
Airline::where('internal_name', "interglobe-aviation-dba-indigo")->update(['name' => "IndiGo"]);
Airline::where('internal_name', "iraero")->update(['name' => "IrAero"]);
Airline::where('internal_name', "iran-air")->update(['name' => "Iran Air"]);
Airline::where('internal_name', "iran-air-tours")->update(['name' => "Iran Air Tour"]);
Airline::where('internal_name', "iran-aseman-airlines")->update(['name' => "Iran Aseman Airlines"]);
Airline::where('internal_name', "iraqi-airways")->update(['name' => "Iraqi Airways"]);
Airline::where('internal_name', "island-transvoyager")->delete();
Airline::where('internal_name', "isles-of-scilly-skybus")->update(['name' => "Isles of Scilly Skybus"]);
Airline::where('internal_name', "israir")->update(['name' => "Israir"]);
Airline::where('internal_name', "ita-airways")->update(['name' => "ITA Airways"]);
Airline::where('internal_name', "izhavia-public-stock")->update(['name' => "Izhavia"]);
Airline::where('internal_name', "jambojet")->update(['name' => "Jambojet"]);
Airline::where('internal_name', "japan-air-commuter")->update(['name' => "Japan Air Commuter"]);
Airline::where('internal_name', "japan-airlines")->update(['name' => "Japan Airlines"]);
Airline::where('internal_name', "jazeera-airways")->update(['name' => "Jazeera Airways"]);
Airline::where('internal_name', "jazz-aviation-lp")->update(['name' => "Jazz Aviation LP"]);
Airline::where('internal_name', "jeju-air")->update(['name' => "Jeju Air"]);
Airline::where('internal_name', "jet2-com")->update(['name' => "Jet2.com"]);
Airline::where('internal_name', "jetblue")->update(['name' => "JetBlue"]);
Airline::where('internal_name', "jetgo")->update(['name' => "JetGo"]);
Airline::where('internal_name', "jetstar-airways-pty")->update(['name' => "Jetstar"]);
Airline::where('internal_name', "jetstar-japan")->update(['name' => "Jetstar Japan"]);
Airline::where('internal_name', "jiangxi-air-limited-dba-jiangxi-air")->update(['name' => "Jiangxi Air"]);
Airline::where('internal_name', "jin-air")->update(['name' => "Jin Air"]);
Airline::where('internal_name', "joint-stock-aviation-rusline")->update(['name' => "RusLine"]);
Airline::where('internal_name', "joint-stock-aurora-airlines")->update(['name' => "Aurora Airlines"]);
Airline::where('internal_name', "jordan-aviation")->update(['name' => "Jordan Aviation"]);
Airline::where('internal_name', "jsc-aircompany-scat")->update(['name' => "SCAT Airlines"]);
Airline::where('internal_name', "jsc-avion-express")->delete();
Airline::where('internal_name', "jsx")->update(['name' => "JSX"]);
Airline::where('internal_name', "juneyao-airlines")->update(['name' => "Juneyao Airlines"]);
Airline::where('internal_name', "kam-air")->update(['name' => "Kam Air"]);
Airline::where('internal_name', "kenmore-air")->update(['name' => "Kenmore Air"]);
Airline::where('internal_name', "kenya-airways")->update(['name' => "Kenya Airways"]);
Airline::where('internal_name', "klm")->update(['name' => "KLM"]);
Airline::where('internal_name', "klm-cityhopper")->update(['name' => "KLM Cityhopper"]);
Airline::where('internal_name', "k-mile-air")->update(['name' => "K-Mile Air"]);
Airline::where('internal_name', "korean-air")->update(['name' => "Korean Air"]);
Airline::where('internal_name', "kunming-airlines")->update(['name' => "Kunming Airlines"]);
Airline::where('internal_name', "kuwait-airways")->update(['name' => "Kuwait Airways"]);
Airline::where('internal_name', "lam")->update(['name' => "LAM Mozambique"]);
Airline::where('internal_name', "lan-airlines")->update(['name' => "Lan Airlines"]);
Airline::where('internal_name', "lan-colombia-airlines")->update(['name' => "Lan Colombia Airlines"]);
Airline::where('internal_name', "lanexang-airways")->update(['name' => "Lanexang Airways"]);
Airline::where('internal_name', "lao-airlines")->update(['name' => "Lao Airlines"]);
Airline::where('internal_name', "lao-skyway")->update(['name' => "Lao Skyway"]);
Airline::where('internal_name', "laser-airlines")->update(['name' => "LASER Airlines"]);
Airline::where('internal_name', "latam")->update(['name' => "LATAM"]);
Airline::where('internal_name', "latam-brasil")->update(['name' => "LATAM Brasil", 'logo' => 'JJ_2.png']);
Airline::where('internal_name', "latam-paraguay")->update(['name' => "LATAM Paraguay"]);
Airline::where('internal_name', "lauda-europe")->update(['name' => "Lauda Europe"]);
Airline::where('internal_name', "level")->update(['name' => "Level"]);
Airline::where('internal_name', "liat-air")->update(['name' => "LIAT Air"]);
Airline::where('internal_name', "libyan-airlines")->update(['name' => "Libyan Airlines"]);
Airline::where('internal_name', "libyan-wings")->update(['name' => "Libyan Wings"]);
Airline::where('internal_name', "linea-aerea-eco-jet-s-a")->update(['name' => "Linea Aerea Eco Jet S.A."]);
Airline::where('internal_name', "link-airways")->update(['name' => "Link Airways"]);
Airline::where('internal_name', "lion-airlines")->update(['name' => "Lion Airlines"]);
Airline::where('internal_name', "lj-air")->update(['name' => "LJ Air"]);
Airline::where('internal_name', "nord-wind")->update(['name' => "Nordwind Airlines"]);
Airline::where('internal_name', "loganair")->update(['name' => "Loganair"]);
Airline::where('internal_name', "lot-polish-airlines")->update(['name' => "LOT Polish Airlines"]);
Airline::where('internal_name', "lucky-air")->update(['name' => "Lucky Air"]);
Airline::where('internal_name', "lufthansa")->update(['name' => "Lufthansa"]);
Airline::where('internal_name', "lufthansa-cargo")->update(['name' => "Lufthansa Cargo"]);
Airline::where('internal_name', "lufthansa-city-airlines")->update(['name' => "Lufthansa City Airlines"]);
Airline::where('internal_name', "lufthansa-cityline")->update(['name' => "Lufthansa CityLine"]);
Airline::where('internal_name', "lufthansa-systems-ag")->delete();
Airline::where('internal_name', "lulutai-airlines")->update(['name' => "Lulutai Airlines"]);
Airline::where('internal_name', "luxair")->update(['name' => "Luxair"]);
Airline::where('internal_name', "mahan-air")->update(['name' => "Mahan Air"]);
Airline::where('internal_name', "malawian-airlines-3w")->update(['name' => "Malawian Airlines"]);
Airline::where('internal_name', "malaysia-airlines")->update(['name' => "Malaysia Airlines"]);
Airline::where('internal_name', "maldivian")->update(['name' => "Maldivian"]);
Airline::where('internal_name', "malindo-airways-sdn-bhd-malindo-a")->update(['name' => "Batik Air Malaysia"]);
Airline::where('internal_name', "malta-air")->update(['name' => "Malta Air"]);
Airline::where('internal_name', "mandarin-airlines")->update(['name' => "Mandarin Airlines"]);
Airline::where('internal_name', "mango-airlines-soc-trading-as-mango")->update(['name' => "Mango"]);
Airline::where('internal_name', "mann-yadanarpon-airlines")->update(['name' => "Mann Yadanarpon Airlines"]);
Airline::where('internal_name', "manta-air")->update(['name' => "Manta Air"]);
Airline::where('internal_name', "marabu")->update(['name' => "Marabu"]);
Airline::where('internal_name', "mas-air")->update(['name' => "MAS AIR"]);
Airline::where('internal_name', "mauritanian-airlines-international")->update(['name' => "Mauritania Airlines"]);
Airline::where('internal_name', "mavi-gok-airlines")->update(['name' => "Mavi Gok Airlines"]);
Airline::where('internal_name', "max-air")->update(['name' => "Max Air"]);
Airline::where('internal_name', "maya-island-air")->update(['name' => "Maya Island Air"]);
Airline::where('internal_name', "mea")->update(['name' => "Middle East Airlines"]);
Airline::where('internal_name', "medsky")->update(['name' => "Medsky"]);
Airline::where('internal_name', "mesa-airlines")->update(['name' => "Mesa Airlines"]);
Airline::where('internal_name', "mexicana-de-aviacion")->update(['name' => "Mexicana de Aviacion"]);
Airline::where('internal_name', "miat-mongolian-airlines")->update(['name' => "MIAT"]);
Airline::where('internal_name', "mingalar")->update(['name' => "Mingalar"]);
Airline::where('internal_name', "mistral-air")->update(['name' => "Mistral Air"]);
Airline::where('internal_name', "monacair")->update(['name' => "Monacair"]);
Airline::where('internal_name', "motor-sich-jsc")->update(['name' => "Motor-Sich"]);
Airline::where('internal_name', "myanmar-airways-international")->update(['name' => "Myanmar Airways International"]);
Airline::where('internal_name', "myanmar-national-airlines")->update(['name' => "Myanmar National Airlines"]);
Airline::where('internal_name', "myway-airlines")->update(['name' => "MyWay Airlines"]);
Airline::where('internal_name', "nam-air")->update(['name' => "Nam Air"]);
Airline::where('internal_name', "national-airlines")->update(['name' => "National Airlines"]);
Airline::where('internal_name', "national-air-dba-flynas")->update(['name' => "Flynas"]);
Airline::where('internal_name', "nauru-air-corporation-t-a-our-airline")->update(['name' => "Nauru Airlines"]);
Airline::where('internal_name', "neos")->update(['name' => "Neos"]);
Airline::where('internal_name', "nepal-airlines-corporation")->update(['name' => "Nepal Airlines"]);
Airline::where('internal_name', "nesma-airlines")->update(['name' => "Nesma Airlines"]);
Airline::where('internal_name', "nexus-airlines")->update(['name' => "Nexus Airlines"]);
Airline::where('internal_name', "ng-eagle")->update(['name' => "NG Eagle"]);
Airline::where('internal_name', "niger-airlines-s-a")->update(['name' => "Niger Airlines"]);
Airline::where('internal_name', "nile-air")->update(['name' => "Nile Air"]);
Airline::where('internal_name', "nine-air")->update(['name' => "Nine Air"]);
Airline::where('internal_name', "nippon-cargo-airlines-nca")->update(['name' => "Nippon Cargo Airlines"]);
Airline::where('internal_name', "nok-airlines-public-limited-dba-nok-air")->update(['name' => "Nok Air"]);
Airline::where('internal_name', "northwestern-air-lease")->update(['name' => "Northwestern Air"]);
Airline::where('internal_name', "north-wright-airways")->update(['name' => "North-Wright Airways"]);
Airline::where('internal_name', "norwegian-air-international")->update(['name' => "Norwegian Air International"]);
Airline::where('internal_name', "norwegian-air-shuttle-a-s")->update(['name' => "Norwegian Air Shuttle"]);
Airline::where('internal_name', "nouvelair")->update(['name' => "Nouvelair"]);
Airline::where('internal_name', "novoair")->update(['name' => "Novoair Limited"]);
Airline::where('internal_name', "ojsc-tajik-air")->update(['name' => "Tajik Air"]);
Airline::where('internal_name', "okay-airways")->update(['name' => "Okay Airways"]);
Airline::where('internal_name', "olympic-air")->update(['name' => "Olympic Air"]);
Airline::where('internal_name', "oman-air")->update(['name' => "Oman Air"]);
Airline::where('internal_name', "open-joint-stock-alrosa-mirny-air-enterprise")->delete();
Airline::where('internal_name', "oriental-air-bridge")->update(['name' => "Oriental Air Bridge"]);
Airline::where('internal_name', "overland-airways")->update(['name' => "Overland Airways"]);
Airline::where('internal_name', "pacific-airlines")->update(['name' => "Pacific Airlines"]);
Airline::where('internal_name', "pal-airlines")->update(['name' => "PAL Airlines"]);
Airline::where('internal_name', "paranair")->update(['name' => "Paranair"]);
Airline::where('internal_name', "passion-air")->update(['name' => "Passion Air"]);
Airline::where('internal_name', "pattaya-airways")->update(['name' => "Pattaya Airways"]);
Airline::where('internal_name', "peach-aviation")->update(['name' => "Peach Aviation Limited"]);
Airline::where('internal_name', "pegasus-airlines")->update(['name' => "Pegasus Airlines"]);
Airline::where('internal_name', "people-s")->update(['name' => "People's"]);
Airline::where('internal_name', "philippine-airlines")->update(['name' => "Philippine Airlines"]);
Airline::where('internal_name', "philippines-airasia")->update(['name' => "Philippines AirAsia"]);
Airline::where('internal_name', "pia")->update(['name' => "Pakistan International Airlines"]);
Airline::where('internal_name', "piedmont-airlines")->update(['name' => "Piedmont Airlines"]);
Airline::where('internal_name', "s-a")->update(['name' => "Plus Ultra"]);
Airline::where('internal_name', "pobeda")->update(['name' => "Pobeda"]);
Airline::where('internal_name', "polar-air-cargo-worldwide")->update(['name' => "Polar Air Cargo Worldwide"]);
Airline::where('internal_name', "polar-airlines-ojsc")->update(['name' => "Polar Airlines"]);
Airline::where('internal_name', "populair")->update(['name' => "Populair"]);
Airline::where('internal_name', "porter-airlines")->update(['name' => "Porter Airlines"]);
Airline::where('internal_name', "privilege-style-s-a")->update(['name' => "Privilege Style"]);
Airline::where('internal_name', "proflight-zambia")->update(['name' => "Proflight Zambia"]);
Airline::where('internal_name', "pt-batik-air-indonesia")->update(['name' => "Batik Air Indonesia"]);
Airline::where('internal_name', "pt-citilink-indonesia")->update(['name' => "Citilink Indonesia"]);
Airline::where('internal_name', "pt-sriwijaya-air")->update(['name' => "Sriwijaya Air"]);
Airline::where('internal_name', "pt-transnusa-aviation-mandiri")->update(['name' => "Transnusa"]);
Airline::where('internal_name', "pt-trigana-air")->update(['name' => "Trigana Air"]);
Airline::where('internal_name', "pt-wings-abadi-airlines")->update(['name' => "Wings Air"]);
Airline::where('internal_name', "qanot-sharq")->update(['name' => "Qanot Sharq"]);
Airline::where('internal_name', "qantas")->update(['name' => "Qantas"]);
Airline::where('internal_name', "qatar-airways")->update(['name' => "Qatar Airways"]);
Airline::where('internal_name', "qeshm-air")->update(['name' => "Qeshm Air"]);
Airline::where('internal_name', "qingdao-airlines")->update(['name' => "Qingdao Airlines"]);
Airline::where('internal_name', "rano-air")->update(['name' => "Rano Air"]);
Airline::where('internal_name', "red-sea-airlines")->update(['name' => "Red Sea Airlines"]);
Airline::where('internal_name', "airlines-400")->update(['name' => "Red Wings"]);
Airline::where('internal_name', "regional-air")->update(['name' => "Regional Air Services"]);
Airline::where('internal_name', "republic-airline")->update(['name' => "Republic Airline Inc.."]);
Airline::where('internal_name', "rex-regional-express")->update(['name' => "REX Regional Express"]);
Airline::where('internal_name', "rise-air")->update(['name' => "Rise Air"]);
Airline::where('internal_name', "riyadh-air")->update(['name' => "Riyadh Air"]);
Airline::where('internal_name', "rossiya-airlines")->update(['name' => "Rossiya Airlines"]);
Airline::where('internal_name', "rotana-jet-aviation-dba-rotana-jet")->update(['name' => "Rotana Jet"]);
Airline::where('internal_name', "royal-air-maroc")->update(['name' => "Royal Air Maroc"]);
Airline::where('internal_name', "royal-brunei")->update(['name' => "Royal Brunei"]);
Airline::where('internal_name', "royal-jordanian")->update(['name' => "Royal Jordanian"]);
Airline::where('internal_name', "ruili-airlines")->update(['name' => "Ruili Airlines"]);
Airline::where('internal_name', "rutaca-airlines")->update(['name' => "Rutaca Airlines"]);
Airline::where('internal_name', "rwandair")->update(['name' => "RwandAir"]);
Airline::where('internal_name', "ryanair")->update(['name' => "Ryanair"]);
Airline::where('internal_name', "ryanair-uk")->update(['name' => "Ryanair UK"]);
Airline::where('internal_name', "s7-airlines")->update(['name' => "S7 Airlines"]);
Airline::where('internal_name', "saa")->update(['name' => "South Africa Airways"]);
Airline::where('internal_name', "safair")->update(['name' => "Safair"]);
Airline::where('internal_name', "salamair")->update(['name' => "SalamAir"]);
Airline::where('internal_name', "samoa-airways")->update(['name' => "Samoa Airways"]);
Airline::where('internal_name', "sas")->update(['name' => "SAS"]);
Airline::where('internal_name', "sata-air-acores")->update(['name' => "SATA Air Açores"]);
Airline::where('internal_name', "sata-internacional")->update(['name' => "SATA Internacional"]);
Airline::where('internal_name', "satena")->update(['name' => "SATENA"]);
Airline::where('internal_name', "saudi-arabian-airlines")->update(['name' => "Saudia"]);
Airline::where('internal_name', "scoot-private")->update(['name' => "Scoot"]);
Airline::where('internal_name', "scott-air")->update(['name' => "Island Air Express"]);
Airline::where('internal_name', "seaborne-airlines")->update(['name' => "Seaborne Airlines"]);
Airline::where('internal_name', "sepehran-airlines")->update(['name' => "Sepehran Airlines"]);
Airline::where('internal_name', "serene-air")->update(['name' => "Serene Air"]);
Airline::where('internal_name', "servicios-aereos-nacionales-s-a-sansa")->update(['name' => "SANSA"]);
Airline::where('internal_name', "severstal-aircompany")->update(['name' => "Severstal Avia"]);
Airline::where('internal_name', "sf-airlines-limited")->update(['name' => "SF Airlines"]);
Airline::where('internal_name', "shandong-airlines")->update(['name' => "Shandong Airlines"]);
Airline::where('internal_name', "shanghai-airlines")->update(['name' => "Shanghai Airlines"]);
Airline::where('internal_name', "sharp-airlines")->update(['name' => "Sharp Airlines"]);
Airline::where('internal_name', "shenzhen-airlines")->update(['name' => "Shenzhen Airlines"]);
Airline::where('internal_name', "shirak-avia")->update(['name' => "Shirak Avia"]);
Airline::where('internal_name', "shree-airlines")->update(['name' => "Shree Airlines"]);
Airline::where('internal_name', "sia-cargo")->update(['name' => "SIA Cargo"]);
Airline::where('internal_name', "sichuan-airlines")->update(['name' => "Sichuan Airlines"]);
Airline::where('internal_name', "silk-way-west-airlines")->update(['name' => "Silk Way West Airlines"]);
Airline::where('internal_name', "singapore-airlines")->update(['name' => "Singapore Airlines"]);
Airline::where('internal_name', "skippers-aviation")->update(['name' => "Skippers Aviation"]);
Airline::where('internal_name', "sky-airline-peru")->update(['name' => "Sky Airline Peru"]);
Airline::where('internal_name', "skyalps")->update(['name' => "SkyAlps"]);
Airline::where('internal_name', "sky-angkor-airlines")->update(['name' => "Sky Angkor Airlines"]);
Airline::where('internal_name', "sky-express-s-a")->update(['name' => "Sky Express"]);
Airline::where('internal_name', "skyfru")->update(['name' => "SkyFru"]);
Airline::where('internal_name', "skymark-airlines")->update(['name' => "Skymark Airlines"]);
Airline::where('internal_name', "sky-taxi-sp-z-o-o")->update(['name' => "SkyTaxi"]);
Airline::where('internal_name', "skyup-airlines")->update(['name' => "SkyUp Airlines"]);
Airline::where('internal_name', "skyup-mt")->update(['name' => "SkyUp MT"]);
Airline::where('internal_name', "skyward-airlines")->update(['name' => "Skyward Airlines"]);
Airline::where('internal_name', "skywest")->update(['name' => "Skywest"]);
Airline::where('internal_name', "skywest-airlines")->update(['name' => "SkyWest Airlines"]);
Airline::where('internal_name', "smartavia")->update(['name' => "Smartavia"]);
Airline::where('internal_name', "smartwings")->update(['name' => "SmartWings"]);
Airline::where('internal_name', "smartwings-hungary")->update(['name' => "Smartwings Hungary"]);
Airline::where('internal_name', "smartwings-poland")->update(['name' => "Smartwings Poland"]);
Airline::where('internal_name', "smartwings-slovakia")->update(['name' => "Smartwings Slovakia"]);
Airline::where('internal_name', "solaseed-air")->update(['name' => "Solaseed Air"]);
Airline::where('internal_name', "solomon-airlines")->update(['name' => "Solomon Airlines"]);
Airline::where('internal_name', "aircompany-somon-air")->update(['name' => "Somon Air"]);
Airline::where('internal_name', "sounds-air-travel-tourism")->update(['name' => "Sounds Air"]);
Airline::where('internal_name', "south-east-asian-airlines-seair-international")->update(['name' => "SEAIR"]);
Airline::where('internal_name', "southern-air-charter")->update(['name' => "Southern Air Charter"]);
Airline::where('internal_name', "southern-airways-express")->update(['name' => "Southern Airways Express"]);
Airline::where('internal_name', "southern-sky-airlines")->update(['name' => "Southern Sky Airlines"]);
Airline::where('internal_name', "southwest-airlines")->update(['name' => "Southwest Airlines"]);
Airline::where('internal_name', "southwind-airlines")->update(['name' => "Southwind Airlines"]);
Airline::where('internal_name', "spicejet")->update(['name' => "SpiceJet"]);
Airline::where('internal_name', "spirit")->delete();
Airline::where('internal_name', "spirit-airlines")->update(['name' => "Spirit"]);
Airline::where('internal_name', "spring-airlines-japan")->update(['name' => "Spring Airlines"]);
Airline::where('internal_name', "spring-japan")->delete();
Airline::where('internal_name', "sprintair-sa")->update(['name' => "Sprintair"]);
Airline::where('internal_name', "srilankan-airlines")->update(['name' => "SriLankan"]);
Airline::where('internal_name', "star-flyer")->update(['name' => "Star Flyer"]);
Airline::where('internal_name', "starlux-airlines")->update(['name' => "Starlux"]);
Airline::where('internal_name', "star-up")->update(['name' => "Star Perú"]);
Airline::where('internal_name', "st-barth-commuter")->update(['name' => "St Barth Commuter"]);
Airline::where('internal_name', "stp-airways")->update(['name' => "STP Airways"]);
Airline::where('internal_name', "sudan-airways")->update(['name' => "Sudan Airways"]);
Airline::where('internal_name', "sun-air-of-scandinavia-a-s")->update(['name' => "Sun-Air"]);
Airline::where('internal_name', "sunclass-airlines")->update(['name' => "Sunclass Airlines"]);
Airline::where('internal_name', "sun-country-airlines")->update(['name' => "Sun Country Airlines"]);
Airline::where('internal_name', "sunexpress")->update(['name' => "SunExpress"]);
Airline::where('internal_name', "sunlight-air")->update(['name' => "Sunlight Air"]);
Airline::where('internal_name', "sun-phuquoc")->update(['name' => "Sun PhuQuoc"]);
Airline::where('internal_name', "sunrise-airways")->update(['name' => "Sunrise Airways"]);
Airline::where('internal_name', "sunrise-airways-s-a")->delete();
Airline::where('internal_name', "sunrise-dominicana")->update(['name' => "Sunrise Dominicana"]);
Airline::where('internal_name', "suparna-airlines")->update(['name' => "Suparna Airlines"]);
Airline::where('internal_name', "super-air-jet")->update(['name' => "Super Air Jet"]);
Airline::where('internal_name', "surinam-airways")->update(['name' => "Surinam Airways"]);
Airline::where('internal_name', "swiss")->update(['name' => "SWISS"]);
Airline::where('internal_name', "sylt-air-gmbh")->update(['name' => "Sylt Air"]);
Airline::where('internal_name', "syrianair")->update(['name' => "Syrianair"]);
Airline::where('internal_name', "taag-angola-airlines")->update(['name' => "TAAG Angola Airlines"]);
Airline::where('internal_name', "tacv-cabo-verde-airlines")->update(['name' => "TACV Cabo Verde Airlines"]);
Airline::where('internal_name', "tailwind-hava-yollari-a-s")->update(['name' => "Tailwind Airlines"]);
Airline::where('internal_name', "tam-linhas-aereas")->update(['name' => "TAM Linhas Aereas"]);
Airline::where('internal_name', "tap-express")->update(['name' => "TAP Express"]);
Airline::where('internal_name', "tap-portugal")->update(['name' => "TAP Portugal"]);
Airline::where('internal_name', "tar-aerolineas")->update(['name' => "TAR Aerolineas"]);
Airline::where('internal_name', "tarco-air")->update(['name' => "Tarco Air"]);
Airline::where('internal_name', "tarom")->update(['name' => "TAROM"]);
Airline::where('internal_name', "tassili-airlines")->delete();
Airline::where('internal_name', "tezjet")->update(['name' => "TezJet"]);
Airline::where('internal_name', "thai-airasia")->update(['name' => "Thai AirAsia"]);
Airline::where('internal_name', "thai-airasia-x-limited")->update(['name' => "Thai Airasia X"]);
Airline::where('internal_name', "thai-airways-international")->update(['name' => "Thai Airways International"]);
Airline::where('internal_name', "thai-lion-air")->update(['name' => "Thai Lion Air"]);
Airline::where('internal_name', "thai-lion-mentari")->delete();
Airline::where('internal_name', "tianjin-airlines")->update(['name' => "Tianjin Airlines"]);
Airline::where('internal_name', "tibet-airlines-corporation")->update(['name' => "Tibet Airlines"]);
Airline::where('internal_name', "tigerair-taiwan")->update(['name' => "Tigerair Taiwan"]);
Airline::where('internal_name', "titan-airways")->update(['name' => "Titan Airways"]);
Airline::where('internal_name', "tnt-airways-s-a")->update(['name' => "TNT Airways"]);
Airline::where('internal_name', "toki-air")->update(['name' => "Toki Air"]);
Airline::where('internal_name', "trade-air")->update(['name' => "Trade Air"]);
Airline::where('internal_name', "tradewind-aviation")->update(['name' => "Tradewind Aviation"]);
Airline::where('internal_name', "transavia-france")->update(['name' => "Transavia France"]);
Airline::where('internal_name', "transportes-aereos-guatemaltecos-s")->update(['name' => "Transportes Aereos Guatemaltecos"]);
Airline::where('internal_name', "tropic-air")->update(['name' => "Tropic Air Limited"]);
Airline::where('internal_name', "tsaradia")->update(['name' => "Tsaradia"]);
Airline::where('internal_name', "tui-airlines-belgium-t-a-jetairfly")->update(['name' => "TUI fly Belgium"]);
Airline::where('internal_name', "arkefly")->update(['name' => "TUI fly Netherlands"]);
Airline::where('internal_name', "tui-airways")->update(['name' => "TUI Airways"]);
Airline::where('internal_name', "tuifly")->update(['name' => "TUI fly Germany"]);
Airline::where('internal_name', "tuifly-nordic-ab")->update(['name' => "TUI fly Nordic"]);
Airline::where('internal_name', "tunisair")->update(['name' => "Tunisair"]);
Airline::where('internal_name', "tunisair-express")->update(['name' => "Tunisair Express"]);
Airline::where('internal_name', "thy-turkish-airlines")->update(['name' => "Turkish Airlines"]);
Airline::where('internal_name', "turkmenistan-airlines")->update(['name' => "Turkmenistan Airlines"]);
Airline::where('internal_name', "turpial")->update(['name' => "Turpial Airlines"]);
Airline::where('internal_name', "tus-airways")->update(['name' => "TUS Airways"]);
Airline::where('internal_name', "t-way-air")->update(['name' => "T'way Air"]);
Airline::where('internal_name', "twin-jet")->update(['name' => "Twin Jet"]);
Airline::where('internal_name', "uganda-airlines")->update(['name' => "Uganda Airlines"]);
Airline::where('internal_name', "ukraine-international-airlines")->update(['name' => "Ukraine International Airlines"]);
Airline::where('internal_name', "uls-airlines-cargo")->update(['name' => "ULS Airlines Cargo"]);
Airline::where('internal_name', "umza-air")->update(['name' => "Umza Air"]);
Airline::where('internal_name', "uni-air")->update(['name' => "Uni Air"]);
Airline::where('internal_name', "united-airlines")->update(['name' => "United Airlines"]);
Airline::where('internal_name', "uniworld-air-cargo-corp")->update(['name' => "Uniworld"]);
Airline::where('internal_name', "ups-airlines")->update(['name' => "UPS Airlines"]);
Airline::where('internal_name', "ural-airlines")->update(['name' => "Ural Airlines"]);
Airline::where('internal_name', "urumqi-airlines")->update(['name' => "Urumqi Air"]);
Airline::where('internal_name', "us-airways")->update(['name' => "US Airways"]);
Airline::where('internal_name', "us-bangla-airlines")->update(['name' => "US-Bangla Airlines"]);
Airline::where('internal_name', "utair")->update(['name' => "UTair"]);
Airline::where('internal_name', "uvt-aero")->update(['name' => "UVT Aero"]);
Airline::where('internal_name', "uzbekistan-airways")->update(['name' => "Uzbekistan Airways"]);
Airline::where('internal_name', "valuejet")->update(['name' => "Valuejet"]);
Airline::where('internal_name', "vasco")->update(['name' => "VASCO"]);
Airline::where('internal_name', "v-australia")->update(['name' => "V Australia"]);
Airline::where('internal_name', "venezolana")->update(['name' => "Venezolana"]);
Airline::where('internal_name', "vieques-air-link")->update(['name' => "Vieques Air Link"]);
Airline::where('internal_name', "vietjet-air-qazaqstan")->update(['name' => "Vietjet Air Qazaqstan"]);
Airline::where('internal_name', "vietjet-aviation-joint-stock")->update(['name' => "Vietjet"]);
Airline::where('internal_name', "vietnam-airlines")->update(['name' => "Vietnam Airlines"]);
Airline::where('internal_name', "vietravel-airlines")->update(['name' => "Vietravel Airlines"]);
Airline::where('internal_name', "flyme")->update(['name' => "Villa Air"]);
Airline::where('internal_name', "virgin-america")->update(['name' => "Virgin America"]);
Airline::where('internal_name', "virgin-atlantic")->update(['name' => "Virgin Atlantic"]);
Airline::where('internal_name', "virgin-australia")->update(['name' => "Virgin Australia"]);
Airline::where('internal_name', "virgin-australia-regional")->update(['name' => "Virgin Australia Regional"]);
Airline::where('internal_name', "virgin-blue-airlines")->update(['name' => "Virgin Blue Airlines"]);
Airline::where('internal_name', "aeroenlaces-nacionales-s-a-de-c-v")->update(['name' => "Viva"]);
Airline::where('internal_name', "volaris")->update(['name' => "Volaris"]);
Airline::where('internal_name', "volaris-costa-rica")->update(['name' => "Volaris Costa Rica"]);
Airline::where('internal_name', "volaris-el-salvador")->update(['name' => "Volaris El Salvador"]);
Airline::where('internal_name', "volotea")->update(['name' => "Volotea"]);
Airline::where('internal_name', "vueling")->update(['name' => "Vueling"]);
Airline::where('internal_name', "wamos-air")->update(['name' => "Wamos Air"]);
Airline::where('internal_name', "wasaya-airways")->update(['name' => "Wasaya Airways"]);
Airline::where('internal_name', "western-air")->update(['name' => "Western Air"]);
Airline::where('internal_name', "westjet")->update(['name' => "WestJet"]);
Airline::where('internal_name', "westjet-encore")->update(['name' => "WestJet Encore"]);
Airline::where('internal_name', "wideroe")->update(['name' => "Wideroe"]);
Airline::where('internal_name', "wind-rose-aviation")->update(['name' => "Wind Rose Aviation Company"]);
Airline::where('internal_name', "wingo")->update(['name' => "Wingo"]);
Airline::where('internal_name', "wingo-panama")->update(['name' => "Wingo Panama"]);
Airline::where('internal_name', "wizz-air")->update(['name' => "Wizz Air Hungary"]);
Airline::where('internal_name', "wizz-air-malta")->update(['name' => "Wizz Air Malta"]);
Airline::where('internal_name', "wizz-air-uk")->update(['name' => "Wizz Air UK"]);
Airline::where('internal_name', "world2fly")->update(['name' => "World2Fly"]);
Airline::where('internal_name', "world2fly-portugal")->update(['name' => "World2Fly Portugal"]);
Airline::where('internal_name', "xiamen-airlines")->update(['name' => "Xiamen Airlines"]);
Airline::where('internal_name', "yakutia-airlines")->update(['name' => "Yakutia Airlines"]);
Airline::where('internal_name', "yamal-airlines")->update(['name' => "Yamal Airlines"]);
Airline::where('internal_name', "yanair")->update(['name' => "Yan Air"]);
Airline::where('internal_name', "yemenia")->update(['name' => "Yemenia"]);
Airline::where('internal_name', "yeti-airlines")->update(['name' => "Yeti Airlines"]);
Airline::where('internal_name', "yto-cargo-airlines")->update(['name' => "YTO Cargo"]);
Airline::where('internal_name', "zambia-airways")->update(['name' => "Zambia Airways"]);
Airline::where('internal_name', "zhejiang-loong-airlines")->update(['name' => "Loong Air"]);
Airline::where('internal_name', "zimex-aviation")->delete();
Airline::where('internal_name', "zipair")->update(['name' => "ZIPAIR"]);
Airline::all()->each(function ($airline) {
$internalName = Str::slug($airline->name);
$airline->update(['internal_name' => $internalName]);
});
Schema::table('airlines', function (Blueprint $table) {
$table->unique('internal_name');
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
//
}
};
@@ -0,0 +1,92 @@
<?php
use App\Models\Airline;
use App\Models\Country;
use App\Models\SeatType;
use App\Models\UserFlight;
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
public function createAirline(
string $name,
bool $active,
string $countryCode,
?string $iataCode = null,
?string $icaoCode = null,
?string $logo = null,
string $internalName = null,
): self {
$country = Country::where('code', $countryCode)->firstOrFail();
$logo = $logo ?? $iataCode . '.png';
Airline::create([
'IATA_code' => $iataCode,
'ICAO_code' => $icaoCode,
'name' => $name,
'internal_name' => $internalName,
'active' => $active,
'logo' => $logo,
'country_id' => $country->id,
]);
return $this;
}
function createAirlines(): void{
$this
->createAirline(name: 'Horizontal Falls Seaplane Adventures', active: true, countryCode: 'AU', logo: 'horizontal-falls-seaplane-adventures.png', internalName: 'horizontal-falls-seaplane-adventures')
->createAirline(name: 'Pineapple Air', active: true, countryCode: 'BS', icaoCode: 'PNP', logo: 'pineapple-air.png', internalName: 'pineapple-air')
->createAirline(name: 'ATA Airlines', active: true, countryCode: 'IR', iataCode: 'I3', icaoCode: 'TBZ', logo: 'ata-airlines.png', internalName: 'ata-airlines')
->createAirline(name: 'Chabahar Air', active: true, countryCode: 'IR', iataCode: null, icaoCode: 'IRU', logo: 'chabahar-airlines.png', internalName: 'chabahar-airlines')
->createAirline(name: 'Kish Air', active: true, countryCode: 'IR', iataCode: 'Y9', icaoCode: 'KIS', logo: 'kish-air.png', internalName: 'kish-air')
->createAirline(name: 'Meraj Airlines', active: true, countryCode: 'IR', iataCode: 'JI', icaoCode: 'MRJ', logo: 'meraj-airlines.png', internalName: 'meraj-airlines')
->createAirline(name: 'Qazaq Air', active: false, countryCode: 'KZ', iataCode: 'IQ', icaoCode: 'QAZ', logo: 'qazaq-air.png', internalName: 'qazaq-air')
->createAirline(name: 'Raimon Airways', active: true, countryCode: 'IR', iataCode: null, icaoCode: 'RAI', logo: 'raimon-airways.png', internalName: 'raimon-airways')
->createAirline(name: 'Saha Airlines', active: true, countryCode: 'IR', iataCode: null, icaoCode: 'IRZ', logo: 'saha-airlines.png', internalName: 'saha-airlines')
->createAirline(name: 'Yazd Airways', active: true, countryCode: 'IR', iataCode: null, icaoCode: 'DZD', logo: 'yazd-airways.png', internalName: 'yazd-airways')
->createAirline(name: 'Zagros Airlines', active: true, countryCode: 'IR', iataCode: 'ZO', icaoCode: 'IZG', logo: 'zagros-airlines.png', internalName: 'zagros-airlines')
->createAirline(name: 'Taban Airlines', active: true, countryCode: 'IR', iataCode: null, icaoCode: 'TBN', logo: 'taban-airlines.png', internalName: 'taban-airlines')
->createAirline(name: 'Maun Helicopter Horizons', active: true, countryCode: 'BW', iataCode: null, icaoCode: null, logo: 'blank.png', internalName: 'maun-helicopter-horizons')
->createAirline(name: 'Pacific Mission Aviation', active: true, countryCode: 'PW', iataCode: null, icaoCode: null, logo: 'pacific-mission-aviation.png', internalName: 'pacific-mission-aviation')
->createAirline(name: 'Jetstar Pacific', active: false, countryCode: 'VN', iataCode: 'BL', icaoCode: 'PIC', logo: 'jq.png', internalName: 'jetstar-pacific')
->createAirline(name: 'Jetsmart', active: true, countryCode: 'CL', iataCode: 'JA', icaoCode: 'JAT', logo: 'ja.png', internalName: 'jetsmart')
->createAirline(name: 'Jetsmart Peru', active: true, countryCode: 'PE', iataCode: 'JZ', icaoCode: 'JAP', logo: 'jz.png', internalName: 'jetsmart-peru')
->createAirline(name: 'Jetsmart Argentina', active: true, countryCode: 'AR', iataCode: 'WJ', icaoCode: 'JES', logo: 'wj.png', internalName: 'jetsmart-argentina')
->createAirline(name: 'Jetsmart Colombia', active: true, countryCode: 'CO', iataCode: 'J6', icaoCode: 'JEC', logo: 'j6.png', internalName: 'jetsmart-colombia')
;
}
public function up(): void
{
DB::table('airlines')->whereNull('logo')->update(['logo' => 'blank.png']);
Schema::table('airlines', function (Blueprint $table) {
$table->string('logo')->default('blank.png')->nullable(false)->change();
});
Airline::where('name', 'AVIANCA')->update(['name' => 'Avianca']);
$this->createAirlines();
UserFlight::where('seat_type_id', null)->update(['seat_type_id' => 0]);
UserFlight::where('flight_reason_id', null)->update(['flight_reason_id' => 0]);
UserFlight::where('flight_class_id', null)->update(['flight_class_id' => 0]);
UserFlight::where('flight_reason_id', 0)->update(['flight_reason_id' => 1]);
SeatType::where('id', 0)->update(['name' => 'Unassigned']);
}
/**
* Reverse the migrations.
*/
public function down(): void
{
//
}
};
@@ -0,0 +1,36 @@
<?php
use App\Models\Airport;
use App\Models\Country;
use App\Models\Region;
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Airport::create([
'name' => 'Horizontal Falls Pontoon',
'region_id' => Region::whereCode('AU-WA')->first()->id,
'municipality' => 'Horizontal Falls',
'latitude_deg' => -16.373295,
'longitude_deg' => 123.964757,
'elevation_ft' => 0,
'type' => 'seaplane_base',
'timezone' => 'Australia/Perth',
]);
}
/**
* Reverse the migrations.
*/
public function down(): void
{
//
}
};
@@ -0,0 +1,36 @@
<?php
use App\Models\Airline;
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
$airlines = [
['internalName' => 'jetstar-pacific', 'logo' => 'JQ.png'],
['internalName' => 'jetsmart', 'logo' => 'JA.png'],
['internalName' => 'jetsmart-peru', 'logo' => 'JZ.png'],
['internalName' => 'jetsmart-argentina', 'logo' => 'WJ.png'],
['internalName' => 'jetsmart-colombia', 'logo' => 'J6.png'],
];
foreach ($airlines as $airline) {
Airline::where('internal_name', $airline['internalName'])
->update(['logo' => $airline['logo']]);
}
}
/**
* Reverse the migrations.
*/
public function down(): void
{
//
}
};
@@ -0,0 +1,142 @@
<?php
use App\Models\FlightClass;
use App\Models\FlightReason;
use App\Models\UserFlight;
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
public function up(): void
{
// ---------------------------------------------------------------------
// Crew Types
// ---------------------------------------------------------------------
Schema::create('crew_types', function (Blueprint $table) {
$table->id();
$table->string('name');
$table->string('internal_name')->unique();
});
DB::table('crew_types')->insert([
['name' => 'Unspecified', 'internal_name' => 'unspecified'],
['name' => 'Cabin Crew', 'internal_name' => 'cabin_crew'],
['name' => 'Purser / CSM', 'internal_name' => 'purser'],
['name' => 'Captain', 'internal_name' => 'captain'],
['name' => 'First Officer', 'internal_name' => 'first_officer'],
['name' => 'Second Officer', 'internal_name' => 'second_officer'],
['name' => 'Deadhead', 'internal_name' => 'deadhead'],
['name' => 'Marshal / Security', 'internal_name' => 'marshal'],
]);
// ---------------------------------------------------------------------
// Followees
// ---------------------------------------------------------------------
Schema::create('followees', function (Blueprint $table) {
$table->id();
$table->foreignId('user_id')->constrained('users')->cascadeOnDelete();
$table->foreignId('followee_id')->constrained('users')->cascadeOnDelete();
$table->timestamps();
$table->unique(['user_id', 'followee_id']);
});
// ---------------------------------------------------------------------
// User Actions
// ---------------------------------------------------------------------
Schema::create('user_actions', function (Blueprint $table) {
$table->id();
$table->foreignId('user_id')->constrained('users')->cascadeOnDelete();
$table->unsignedBigInteger('user_flight_id');
$table->text('message');
$table->timestamps();
});
// ---------------------------------------------------------------------
// Achievements
// ---------------------------------------------------------------------
Schema::create('achievements', function (Blueprint $table) {
$table->id();
$table->string('name');
$table->string('internal_name')->unique();
$table->text('description');
$table->string('icon');
});
// ---------------------------------------------------------------------
// User Achievements
// ---------------------------------------------------------------------
Schema::create('user_achievements', function (Blueprint $table) {
$table->id();
$table->foreignId('user_id')->constrained('users')->cascadeOnDelete();
$table->foreignId('achievement_id')->constrained('achievements')->cascadeOnDelete();
$table->timestamps();
$table->unique(['user_id', 'achievement_id']);
});
DB::statement('ALTER TABLE flight_classes ALTER COLUMN id ADD GENERATED BY DEFAULT AS IDENTITY');
DB::statement('ALTER TABLE flight_reasons ALTER COLUMN id ADD GENERATED BY DEFAULT AS IDENTITY');
DB::statement("
SELECT setval(
pg_get_serial_sequence('flight_classes', 'id'),
(SELECT MAX(id) FROM flight_classes)
)
");
DB::statement("
SELECT setval(
pg_get_serial_sequence('flight_reasons', 'id'),
(SELECT MAX(id) FROM flight_reasons)
)
");
DB::table('flight_classes')->insert([
['name' => 'General Aviation'],
['name' => 'Crew'],
]);
DB::table('flight_reasons')->insert([
['name' => 'Visiting Friends / Relatives'],
]);
Schema::table('flight_classes', function (Blueprint $table) {
$table->string('internal_name')->nullable();
});
DB::table('flight_classes')->get()->each(function ($row) {
DB::table('flight_classes')
->where('id', $row->id)
->update(['internal_name' => Str::slug($row->name, '_')]);
});
Schema::table('flight_classes', function (Blueprint $table) {
$table->string('internal_name')->nullable(false)->unique()->change();
});
Schema::table('user_flights', function (Blueprint $table) {
$table->foreignId('crew_type_id')->nullable()->constrained('crew_types')->nullOnDelete();
});
$economy = FlightClass::where('internal_name', 'economy')->first();
$unspecified = FlightClass::where('internal_name', 'unspecified')->first();
UserFlight::where('flight_class_id', $unspecified->id)->update(['flight_class_id' => $economy->id]);
FlightReason::where('name', 'Other')->update(['id' => 999]);
}
public function down(): void
{
Schema::dropIfExists('user_achievements');
Schema::dropIfExists('achievements');
Schema::dropIfExists('user_actions');
Schema::dropIfExists('followees');
Schema::dropIfExists('crew_types');
DB::table('flight_classes')->whereIn('name', ['General Aviation', 'Crew'])->delete();
DB::table('flight_reasons')->where('name', 'Crew')->delete();
}
};
@@ -0,0 +1,65 @@
<?php
use App\Models\Airline;
use App\Models\Country;
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
public function createAirline(
string $name,
bool $active,
string $countryCode,
?string $iataCode = null,
?string $icaoCode = null,
?string $logo = null,
?string $internalName = null,
): self {
$country = Country::where('code', $countryCode)->firstOrFail();
$internalName = $internalName ?? Str::slug($name);
$logo = $logo ?? $iataCode . '.png';
Airline::create([
'IATA_code' => $iataCode,
'ICAO_code' => $icaoCode,
'name' => $name,
'internal_name' => $internalName,
'active' => $active,
'logo' => $logo,
'country_id' => $country->id,
]);
return $this;
}
/**
* Run the migrations.
*/
public function up(): void
{
$this
->createAirline(name: 'Fly540', active: false, countryCode: 'KE', iataCode: '5H', icaoCode: 'FFV', logo: 'fly540.png')
->createAirline(name: 'Ansett Australia', active: false, countryCode: 'AU', iataCode: 'AN', icaoCode: 'AAA', logo: 'ansett.png')
->createAirline(name: 'Ansett New Zealand', active: false, countryCode: 'AU', iataCode: 'ZQ', icaoCode: 'NZA', logo: 'ansett.png')
->createAirline(name: 'Flight West', active: false, countryCode: 'AU', iataCode: 'YC', icaoCode: 'FWQ', logo: 'flight-west.png')
->createAirline(name: 'Antarctic Airways', active: true, countryCode: 'CL', iataCode: 'V5', icaoCode: 'DAP', logo: 'antarctic-airways.png')
->createAirline(name: 'Amaszonas Uruguay', active: false, countryCode: 'UY', iataCode: 'Z7', icaoCode: 'AUZ', logo: 'amaszonas-uruguay.png')
->createAirline(name: 'Amaszonas', active: false, countryCode: 'BO', iataCode: 'Z8', icaoCode: 'AZN', logo: 'amaszonas.png')
->createAirline(name: 'Czech Airlines', active: false, countryCode: 'CZ', iataCode: 'OK', icaoCode: 'CSA', logo: 'csa-czech-airlines.png')
;
}
/**
* Reverse the migrations.
*/
public function down(): void
{
//
}
};
@@ -0,0 +1,24 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
//
}
/**
* Reverse the migrations.
*/
public function down(): void
{
//
}
};
@@ -0,0 +1,29 @@
<?php
use App\Models\Airport;
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
public function up(): void
{
Schema::table('user_actions', function (Blueprint $table) {
$table->dropColumn('message');
$table->string('type')->after('user_flight_id');
$table->dropColumn('user_flight_id');
$table->json('data')->after('type');
});
Airport::whereMunicipality('Fayetteville/Springdale/Rogers')->update(['municipality' => 'Fayetteville']);
}
public function down(): void
{
Schema::table('user_actions', function (Blueprint $table) {
$table->dropColumn(['type', 'data']);
$table->text('message')->after('user_flight_id');
});
}
};
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,33 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::create('personal_access_tokens', function (Blueprint $table) {
$table->id();
$table->morphs('tokenable');
$table->text('name');
$table->string('token', 64)->unique();
$table->text('abilities')->nullable();
$table->timestamp('last_used_at')->nullable();
$table->timestamp('expires_at')->nullable()->index();
$table->timestamps();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('personal_access_tokens');
}
};
+3
View File
@@ -20,6 +20,9 @@ http {
fastcgi_param HTTPS on; fastcgi_param HTTPS on;
fastcgi_param HTTP_X_FORWARDED_PROTO https; fastcgi_param HTTP_X_FORWARDED_PROTO https;
include fastcgi_params; include fastcgi_params;
fastcgi_buffers 32 32k;
fastcgi_buffer_size 64k;
} }
} }
} }
+342 -1
View File
@@ -6,13 +6,20 @@
"": { "": {
"dependencies": { "dependencies": {
"@mdi/font": "^7.4.47", "@mdi/font": "^7.4.47",
"apexcharts": "^5.10.5",
"chart.js": "^4.5.1",
"echarts": "^6.0.0",
"flag-icons": "^7.5.0", "flag-icons": "^7.5.0",
"maplibre-gl": "^5.22.0",
"vue-echarts": "^8.0.1",
"vue3-apexcharts": "^1.11.1",
"vuetify": "^4.0.5" "vuetify": "^4.0.5"
}, },
"devDependencies": { "devDependencies": {
"@inertiajs/vue3": "^2.0.0", "@inertiajs/vue3": "^2.0.0",
"@tailwindcss/forms": "^0.5.3", "@tailwindcss/forms": "^0.5.3",
"@tailwindcss/vite": "^4.0.0", "@tailwindcss/vite": "^4.0.0",
"@types/leaflet": "^1.9.21",
"@types/node": "^25.5.0", "@types/node": "^25.5.0",
"@vitejs/plugin-vue": "^6.0.0", "@vitejs/plugin-vue": "^6.0.0",
"autoprefixer": "^10.4.12", "autoprefixer": "^10.4.12",
@@ -176,6 +183,117 @@
"@jridgewell/sourcemap-codec": "^1.4.14" "@jridgewell/sourcemap-codec": "^1.4.14"
} }
}, },
"node_modules/@kurkle/color": {
"version": "0.3.4",
"resolved": "https://registry.npmjs.org/@kurkle/color/-/color-0.3.4.tgz",
"integrity": "sha512-M5UknZPHRu3DEDWoipU6sE8PdkZ6Z/S+v4dD+Ke8IaNlpdSQah50lz1KtcFBa2vsdOnwbbnxJwVM4wty6udA5w==",
"license": "MIT"
},
"node_modules/@mapbox/jsonlint-lines-primitives": {
"version": "2.0.2",
"resolved": "https://registry.npmjs.org/@mapbox/jsonlint-lines-primitives/-/jsonlint-lines-primitives-2.0.2.tgz",
"integrity": "sha512-rY0o9A5ECsTQRVhv7tL/OyDpGAoUB4tTvLiW1DSzQGq4bvTPhNw1VpSNjDJc5GFZ2XuyOtSWSVN05qOtcD71qQ==",
"engines": {
"node": ">= 0.6"
}
},
"node_modules/@mapbox/point-geometry": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/@mapbox/point-geometry/-/point-geometry-1.1.0.tgz",
"integrity": "sha512-YGcBz1cg4ATXDCM/71L9xveh4dynfGmcLDqufR+nQQy3fKwsAZsWd/x4621/6uJaeB9mwOHE6hPeDgXz9uViUQ==",
"license": "ISC"
},
"node_modules/@mapbox/tiny-sdf": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/@mapbox/tiny-sdf/-/tiny-sdf-2.1.0.tgz",
"integrity": "sha512-uFJhNh36BR4OCuWIEiWaEix9CA2WzT6CAIcqVjWYpnx8+QDtS+oC4QehRrx5cX4mgWs37MmKnwUejeHxVymzNg==",
"license": "BSD-2-Clause"
},
"node_modules/@mapbox/unitbezier": {
"version": "0.0.1",
"resolved": "https://registry.npmjs.org/@mapbox/unitbezier/-/unitbezier-0.0.1.tgz",
"integrity": "sha512-nMkuDXFv60aBr9soUG5q+GvZYL+2KZHVvsqFCzqnkGEf46U2fvmytHaEVc1/YZbiLn8X+eR3QzX1+dwDO1lxlw==",
"license": "BSD-2-Clause"
},
"node_modules/@mapbox/vector-tile": {
"version": "2.0.4",
"resolved": "https://registry.npmjs.org/@mapbox/vector-tile/-/vector-tile-2.0.4.tgz",
"integrity": "sha512-AkOLcbgGTdXScosBWwmmD7cDlvOjkg/DetGva26pIRiZPdeJYjYKarIlb4uxVzi6bwHO6EWH82eZ5Nuv4T5DUg==",
"license": "BSD-3-Clause",
"dependencies": {
"@mapbox/point-geometry": "~1.1.0",
"@types/geojson": "^7946.0.16",
"pbf": "^4.0.1"
}
},
"node_modules/@mapbox/whoots-js": {
"version": "3.1.0",
"resolved": "https://registry.npmjs.org/@mapbox/whoots-js/-/whoots-js-3.1.0.tgz",
"integrity": "sha512-Es6WcD0nO5l+2BOQS4uLfNPYQaNDfbot3X1XUoloz+x0mPDS3eeORZJl06HXjwBG1fOGwCRnzK88LMdxKRrd6Q==",
"license": "ISC",
"engines": {
"node": ">=6.0.0"
}
},
"node_modules/@maplibre/geojson-vt": {
"version": "6.0.4",
"resolved": "https://registry.npmjs.org/@maplibre/geojson-vt/-/geojson-vt-6.0.4.tgz",
"integrity": "sha512-HYv3POhMRCdhP3UPPATM/hfcy6/WuVIf5FKboH8u/ZuFMTnAIcSVlq5nfOqroLokd925w2QtE7YwquFOIacwVQ==",
"license": "ISC",
"dependencies": {
"kdbush": "^4.0.2"
}
},
"node_modules/@maplibre/maplibre-gl-style-spec": {
"version": "24.8.1",
"resolved": "https://registry.npmjs.org/@maplibre/maplibre-gl-style-spec/-/maplibre-gl-style-spec-24.8.1.tgz",
"integrity": "sha512-zxa92qF96ZNojLxeAjnaRpjVCy+swoUNJvDhtpC90k7u5F0TMr4GmvNqMKvYrMoPB8d7gRSXbMG1hBbmgESIsw==",
"license": "ISC",
"dependencies": {
"@mapbox/jsonlint-lines-primitives": "~2.0.2",
"@mapbox/unitbezier": "^0.0.1",
"json-stringify-pretty-compact": "^4.0.0",
"minimist": "^1.2.8",
"quickselect": "^3.0.0",
"rw": "^1.3.3",
"tinyqueue": "^3.0.0"
},
"bin": {
"gl-style-format": "dist/gl-style-format.mjs",
"gl-style-migrate": "dist/gl-style-migrate.mjs",
"gl-style-validate": "dist/gl-style-validate.mjs"
}
},
"node_modules/@maplibre/mlt": {
"version": "1.1.8",
"resolved": "https://registry.npmjs.org/@maplibre/mlt/-/mlt-1.1.8.tgz",
"integrity": "sha512-8vtfYGidr1rNkv5IwIoU2lfe3Oy+Wa8HluzQYcQi9cveU9K3pweAal/poQj4GJ0K/EW4bTQp2wVAs09g2yDRZg==",
"license": "(MIT OR Apache-2.0)",
"dependencies": {
"@mapbox/point-geometry": "^1.1.0"
}
},
"node_modules/@maplibre/vt-pbf": {
"version": "4.3.0",
"resolved": "https://registry.npmjs.org/@maplibre/vt-pbf/-/vt-pbf-4.3.0.tgz",
"integrity": "sha512-jIvp8F5hQCcreqOOpEt42TJMUlsrEcpf/kI1T2v85YrQRV6PPXUcEXUg5karKtH6oh47XJZ4kHu56pUkOuqA7w==",
"license": "MIT",
"dependencies": {
"@mapbox/point-geometry": "^1.1.0",
"@mapbox/vector-tile": "^2.0.4",
"@maplibre/geojson-vt": "^5.0.4",
"@types/geojson": "^7946.0.16",
"@types/supercluster": "^7.1.3",
"pbf": "^4.0.1",
"supercluster": "^8.0.1"
}
},
"node_modules/@maplibre/vt-pbf/node_modules/@maplibre/geojson-vt": {
"version": "5.0.4",
"resolved": "https://registry.npmjs.org/@maplibre/geojson-vt/-/geojson-vt-5.0.4.tgz",
"integrity": "sha512-KGg9sma45S+stfH9vPCJk1J0lSDLWZgCT9Y8u8qWZJyjFlP8MNP1WGTxIMYJZjDvVT3PDn05kN1C95Sut1HpgQ==",
"license": "ISC"
},
"node_modules/@mdi/font": { "node_modules/@mdi/font": {
"version": "7.4.47", "version": "7.4.47",
"resolved": "https://registry.npmjs.org/@mdi/font/-/font-7.4.47.tgz", "resolved": "https://registry.npmjs.org/@mdi/font/-/font-7.4.47.tgz",
@@ -804,6 +922,22 @@
"tslib": "^2.4.0" "tslib": "^2.4.0"
} }
}, },
"node_modules/@types/geojson": {
"version": "7946.0.16",
"resolved": "https://registry.npmjs.org/@types/geojson/-/geojson-7946.0.16.tgz",
"integrity": "sha512-6C8nqWur3j98U6+lXDfTUWIfgvZU+EumvpHKcYjujKH7woYyLj2sUmff0tRhrqM7BohUw7Pz3ZB1jj2gW9Fvmg==",
"license": "MIT"
},
"node_modules/@types/leaflet": {
"version": "1.9.21",
"resolved": "https://registry.npmjs.org/@types/leaflet/-/leaflet-1.9.21.tgz",
"integrity": "sha512-TbAd9DaPGSnzp6QvtYngntMZgcRk+igFELwR2N99XZn7RXUdKgsXMR+28bUO0rPsWp8MIu/f47luLIQuSLYv/w==",
"dev": true,
"license": "MIT",
"dependencies": {
"@types/geojson": "*"
}
},
"node_modules/@types/lodash": { "node_modules/@types/lodash": {
"version": "4.17.24", "version": "4.17.24",
"resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.17.24.tgz", "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.17.24.tgz",
@@ -832,6 +966,15 @@
"undici-types": "~7.18.0" "undici-types": "~7.18.0"
} }
}, },
"node_modules/@types/supercluster": {
"version": "7.1.3",
"resolved": "https://registry.npmjs.org/@types/supercluster/-/supercluster-7.1.3.tgz",
"integrity": "sha512-Z0pOY34GDFl3Q6hUFYf3HkTwKEE02e7QgtJppBt+beEAxnyOpJua+voGFvxINBHa06GwLFFym7gRPY2SiKIfIA==",
"license": "MIT",
"dependencies": {
"@types/geojson": "*"
}
},
"node_modules/@vitejs/plugin-vue": { "node_modules/@vitejs/plugin-vue": {
"version": "6.0.5", "version": "6.0.5",
"resolved": "https://registry.npmjs.org/@vitejs/plugin-vue/-/plugin-vue-6.0.5.tgz", "resolved": "https://registry.npmjs.org/@vitejs/plugin-vue/-/plugin-vue-6.0.5.tgz",
@@ -1030,6 +1173,13 @@
"url": "https://github.com/sponsors/jonschlinkert" "url": "https://github.com/sponsors/jonschlinkert"
} }
}, },
"node_modules/apexcharts": {
"version": "5.10.5",
"resolved": "https://registry.npmjs.org/apexcharts/-/apexcharts-5.10.5.tgz",
"integrity": "sha512-RirosfLQLqYpWBdn4Pdv9B1M0M2FepzVxPRpcuXQPTilvuZvKt02vgVlEexhCVu2p4fApDIV/3yC9voAIK+qjw==",
"license": "SEE LICENSE IN LICENSE",
"peer": true
},
"node_modules/arg": { "node_modules/arg": {
"version": "5.0.2", "version": "5.0.2",
"resolved": "https://registry.npmjs.org/arg/-/arg-5.0.2.tgz", "resolved": "https://registry.npmjs.org/arg/-/arg-5.0.2.tgz",
@@ -2235,6 +2385,18 @@
"node": ">=8" "node": ">=8"
} }
}, },
"node_modules/chart.js": {
"version": "4.5.1",
"resolved": "https://registry.npmjs.org/chart.js/-/chart.js-4.5.1.tgz",
"integrity": "sha512-GIjfiT9dbmHRiYi6Nl2yFCq7kkwdkp1W/lp2J99rX0yo9tgJGn3lKQATztIjb5tVtevcBtIdICNWqlq5+E8/Pw==",
"license": "MIT",
"dependencies": {
"@kurkle/color": "^0.3.0"
},
"engines": {
"pnpm": ">=8"
}
},
"node_modules/chokidar": { "node_modules/chokidar": {
"version": "3.6.0", "version": "3.6.0",
"resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.6.0.tgz", "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.6.0.tgz",
@@ -2499,6 +2661,28 @@
"node": ">= 0.4" "node": ">= 0.4"
} }
}, },
"node_modules/earcut": {
"version": "3.0.2",
"resolved": "https://registry.npmjs.org/earcut/-/earcut-3.0.2.tgz",
"integrity": "sha512-X7hshQbLyMJ/3RPhyObLARM2sNxxmRALLKx1+NVFFnQ9gKzmCrxm9+uLIAdBcvc8FNLpctqlQ2V6AE92Ol9UDQ==",
"license": "ISC"
},
"node_modules/echarts": {
"version": "6.0.0",
"resolved": "https://registry.npmjs.org/echarts/-/echarts-6.0.0.tgz",
"integrity": "sha512-Tte/grDQRiETQP4xz3iZWSvoHrkCQtwqd6hs+mifXcjrCuo2iKWbajFObuLJVBlDIJlOzgQPd1hsaKt/3+OMkQ==",
"license": "Apache-2.0",
"dependencies": {
"tslib": "2.3.0",
"zrender": "6.0.0"
}
},
"node_modules/echarts/node_modules/tslib": {
"version": "2.3.0",
"resolved": "https://registry.npmjs.org/tslib/-/tslib-2.3.0.tgz",
"integrity": "sha512-N82ooyxVNm6h1riLCoyS9e3fuJ3AMG2zIZs2Gd1ATcSFjSA23Q0fzjjZeh0jbJvWVDZ0cJT8yaNNaaXHzueNjg==",
"license": "0BSD"
},
"node_modules/electron-to-chromium": { "node_modules/electron-to-chromium": {
"version": "1.5.331", "version": "1.5.331",
"resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.331.tgz", "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.331.tgz",
@@ -2835,6 +3019,12 @@
"node": ">= 0.4" "node": ">= 0.4"
} }
}, },
"node_modules/gl-matrix": {
"version": "3.4.4",
"resolved": "https://registry.npmjs.org/gl-matrix/-/gl-matrix-3.4.4.tgz",
"integrity": "sha512-latSnyDNt/8zYUB6VIJ6PCh2jBjJX6gnDsoCZ7LyW7GkqrD51EWwa9qCoGixj8YqBtETQK/xY7OmpTF8xz1DdQ==",
"license": "MIT"
},
"node_modules/glob-parent": { "node_modules/glob-parent": {
"version": "6.0.2", "version": "6.0.2",
"resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz", "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz",
@@ -3096,6 +3286,12 @@
"jsesc": "bin/jsesc" "jsesc": "bin/jsesc"
} }
}, },
"node_modules/json-stringify-pretty-compact": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/json-stringify-pretty-compact/-/json-stringify-pretty-compact-4.0.0.tgz",
"integrity": "sha512-3CNZ2DnrpByG9Nqj6Xo8vqbjT4F6N+tb4Gb28ESAZjYZ5yqvmc56J+/kuIwkaAMOyblTQhUW7PxMkUb8Q36N3Q==",
"license": "MIT"
},
"node_modules/json5": { "node_modules/json5": {
"version": "0.5.1", "version": "0.5.1",
"resolved": "https://registry.npmjs.org/json5/-/json5-0.5.1.tgz", "resolved": "https://registry.npmjs.org/json5/-/json5-0.5.1.tgz",
@@ -3106,6 +3302,12 @@
"json5": "lib/cli.js" "json5": "lib/cli.js"
} }
}, },
"node_modules/kdbush": {
"version": "4.0.2",
"resolved": "https://registry.npmjs.org/kdbush/-/kdbush-4.0.2.tgz",
"integrity": "sha512-WbCVYJ27Sz8zi9Q7Q0xHC+05iwkm3Znipc2XTlrnJbsHMYktW4hPhXUE8Ys1engBrvffoSCqbil1JQAa7clRpA==",
"license": "ISC"
},
"node_modules/laravel-precognition": { "node_modules/laravel-precognition": {
"version": "1.0.2", "version": "1.0.2",
"resolved": "https://registry.npmjs.org/laravel-precognition/-/laravel-precognition-1.0.2.tgz", "resolved": "https://registry.npmjs.org/laravel-precognition/-/laravel-precognition-1.0.2.tgz",
@@ -3455,6 +3657,40 @@
"@jridgewell/sourcemap-codec": "^1.5.5" "@jridgewell/sourcemap-codec": "^1.5.5"
} }
}, },
"node_modules/maplibre-gl": {
"version": "5.22.0",
"resolved": "https://registry.npmjs.org/maplibre-gl/-/maplibre-gl-5.22.0.tgz",
"integrity": "sha512-nc8YA+YSEioMZg5W0cb6Cf3wQ8aJge66dsttyBgpOArOnlmFJO1Kc5G32kYVPeUYhLpBja83T99uanmJvYAIyQ==",
"license": "BSD-3-Clause",
"dependencies": {
"@mapbox/jsonlint-lines-primitives": "^2.0.2",
"@mapbox/point-geometry": "^1.1.0",
"@mapbox/tiny-sdf": "^2.0.7",
"@mapbox/unitbezier": "^0.0.1",
"@mapbox/vector-tile": "^2.0.4",
"@mapbox/whoots-js": "^3.1.0",
"@maplibre/geojson-vt": "^6.0.4",
"@maplibre/maplibre-gl-style-spec": "^24.8.1",
"@maplibre/mlt": "^1.1.8",
"@maplibre/vt-pbf": "^4.3.0",
"@types/geojson": "^7946.0.16",
"earcut": "^3.0.2",
"gl-matrix": "^3.4.4",
"kdbush": "^4.0.2",
"murmurhash-js": "^1.0.0",
"pbf": "^4.0.1",
"potpack": "^2.1.0",
"quickselect": "^3.0.0",
"tinyqueue": "^3.0.0"
},
"engines": {
"node": ">=16.14.0",
"npm": ">=8.1.0"
},
"funding": {
"url": "https://github.com/maplibre/maplibre-gl-js?sponsor=1"
}
},
"node_modules/math-intrinsics": { "node_modules/math-intrinsics": {
"version": "1.1.0", "version": "1.1.0",
"resolved": "https://registry.npmjs.org/math-intrinsics/-/math-intrinsics-1.1.0.tgz", "resolved": "https://registry.npmjs.org/math-intrinsics/-/math-intrinsics-1.1.0.tgz",
@@ -3552,7 +3788,6 @@
"version": "1.2.8", "version": "1.2.8",
"resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz", "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz",
"integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==", "integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==",
"dev": true,
"license": "MIT", "license": "MIT",
"funding": { "funding": {
"url": "https://github.com/sponsors/ljharb" "url": "https://github.com/sponsors/ljharb"
@@ -3578,6 +3813,12 @@
"dev": true, "dev": true,
"license": "MIT" "license": "MIT"
}, },
"node_modules/murmurhash-js": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/murmurhash-js/-/murmurhash-js-1.0.0.tgz",
"integrity": "sha512-TvmkNhkv8yct0SVBSy+o8wYzXjE4Zz3PCesbfs8HiCXXdcTuocApFv11UWlNFWKYsP2okqrhb7JNlSm9InBhIw==",
"license": "MIT"
},
"node_modules/mz": { "node_modules/mz": {
"version": "2.7.0", "version": "2.7.0",
"resolved": "https://registry.npmjs.org/mz/-/mz-2.7.0.tgz", "resolved": "https://registry.npmjs.org/mz/-/mz-2.7.0.tgz",
@@ -3695,6 +3936,18 @@
"dev": true, "dev": true,
"license": "MIT" "license": "MIT"
}, },
"node_modules/pbf": {
"version": "4.0.1",
"resolved": "https://registry.npmjs.org/pbf/-/pbf-4.0.1.tgz",
"integrity": "sha512-SuLdBvS42z33m8ejRbInMapQe8n0D3vN/Xd5fmWM3tufNgRQFBpaW2YVJxQZV4iPNqb0vEFvssMEo5w9c6BTIA==",
"license": "BSD-3-Clause",
"dependencies": {
"resolve-protobuf-schema": "^2.1.0"
},
"bin": {
"pbf": "bin/pbf"
}
},
"node_modules/picocolors": { "node_modules/picocolors": {
"version": "1.1.1", "version": "1.1.1",
"resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz", "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz",
@@ -3898,6 +4151,12 @@
"dev": true, "dev": true,
"license": "MIT" "license": "MIT"
}, },
"node_modules/potpack": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/potpack/-/potpack-2.1.0.tgz",
"integrity": "sha512-pcaShQc1Shq0y+E7GqJqvZj8DTthWV1KeHGdi0Z6IAin2Oi3JnLCOfwnCo84qc+HAp52wT9nK9H7FAJp5a44GQ==",
"license": "ISC"
},
"node_modules/private": { "node_modules/private": {
"version": "0.1.8", "version": "0.1.8",
"resolved": "https://registry.npmjs.org/private/-/private-0.1.8.tgz", "resolved": "https://registry.npmjs.org/private/-/private-0.1.8.tgz",
@@ -3908,6 +4167,12 @@
"node": ">= 0.6" "node": ">= 0.6"
} }
}, },
"node_modules/protocol-buffers-schema": {
"version": "3.6.1",
"resolved": "https://registry.npmjs.org/protocol-buffers-schema/-/protocol-buffers-schema-3.6.1.tgz",
"integrity": "sha512-VG2K63Igkiv9p76tk1lilczEK1cT+kCjKtkdhw1dQZV3k3IXJbd3o6Ho8b9zJZaHSnT2hKe4I+ObmX9w6m5SmQ==",
"license": "MIT"
},
"node_modules/proxy-from-env": { "node_modules/proxy-from-env": {
"version": "2.1.0", "version": "2.1.0",
"resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-2.1.0.tgz", "resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-2.1.0.tgz",
@@ -3962,6 +4227,12 @@
], ],
"license": "MIT" "license": "MIT"
}, },
"node_modules/quickselect": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/quickselect/-/quickselect-3.0.0.tgz",
"integrity": "sha512-XdjUArbK4Bm5fLLvlm5KpTFOiOThgfWWI4axAZDWg4E/0mKdZyI9tNEfds27qCi1ze/vwTR16kvmmGhRra3c2g==",
"license": "ISC"
},
"node_modules/read-cache": { "node_modules/read-cache": {
"version": "1.0.0", "version": "1.0.0",
"resolved": "https://registry.npmjs.org/read-cache/-/read-cache-1.0.0.tgz", "resolved": "https://registry.npmjs.org/read-cache/-/read-cache-1.0.0.tgz",
@@ -4109,6 +4380,15 @@
"url": "https://github.com/sponsors/ljharb" "url": "https://github.com/sponsors/ljharb"
} }
}, },
"node_modules/resolve-protobuf-schema": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/resolve-protobuf-schema/-/resolve-protobuf-schema-2.1.0.tgz",
"integrity": "sha512-kI5ffTiZWmJaS/huM8wZfEMer1eRd7oJQhDuxeCLe3t7N7mX3z94CN0xPxBQxFYQTSNz9T0i+v6inKqSdK8xrQ==",
"license": "MIT",
"dependencies": {
"protocol-buffers-schema": "^3.3.1"
}
},
"node_modules/reusify": { "node_modules/reusify": {
"version": "1.1.0", "version": "1.1.0",
"resolved": "https://registry.npmjs.org/reusify/-/reusify-1.1.0.tgz", "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.1.0.tgz",
@@ -4178,6 +4458,12 @@
"queue-microtask": "^1.2.2" "queue-microtask": "^1.2.2"
} }
}, },
"node_modules/rw": {
"version": "1.3.3",
"resolved": "https://registry.npmjs.org/rw/-/rw-1.3.3.tgz",
"integrity": "sha512-PdhdWy89SiZogBLaw42zdeqtRJ//zFd2PgQavcICDUgJT5oW10QCRKbJ6bg4r0/UY2M6BWd5tkxuGFRvCkgfHQ==",
"license": "BSD-3-Clause"
},
"node_modules/rxjs": { "node_modules/rxjs": {
"version": "7.8.2", "version": "7.8.2",
"resolved": "https://registry.npmjs.org/rxjs/-/rxjs-7.8.2.tgz", "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-7.8.2.tgz",
@@ -4390,6 +4676,15 @@
"node": ">=16 || 14 >=14.17" "node": ">=16 || 14 >=14.17"
} }
}, },
"node_modules/supercluster": {
"version": "8.0.1",
"resolved": "https://registry.npmjs.org/supercluster/-/supercluster-8.0.1.tgz",
"integrity": "sha512-IiOea5kJ9iqzD2t7QJq/cREyLHTtSmUT6gQsweojg9WH2sYJqZK9SswTu6jrscO6D1G5v5vYZ9ru/eq85lXeZQ==",
"license": "ISC",
"dependencies": {
"kdbush": "^4.0.2"
}
},
"node_modules/supports-color": { "node_modules/supports-color": {
"version": "8.1.1", "version": "8.1.1",
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz",
@@ -4522,6 +4817,12 @@
"url": "https://github.com/sponsors/SuperchupuDev" "url": "https://github.com/sponsors/SuperchupuDev"
} }
}, },
"node_modules/tinyqueue": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/tinyqueue/-/tinyqueue-3.0.0.tgz",
"integrity": "sha512-gRa9gwYU3ECmQYv3lslts5hxuIa90veaEcxDYuu3QGOIAEM2mOZkVHp48ANJuu1CURtRdHKUBY5Lm1tHV+sD4g==",
"license": "ISC"
},
"node_modules/to-fast-properties": { "node_modules/to-fast-properties": {
"version": "1.0.3", "version": "1.0.3",
"resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-1.0.3.tgz", "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-1.0.3.tgz",
@@ -4821,6 +5122,31 @@
} }
} }
}, },
"node_modules/vue-echarts": {
"version": "8.0.1",
"resolved": "https://registry.npmjs.org/vue-echarts/-/vue-echarts-8.0.1.tgz",
"integrity": "sha512-23rJTFLu1OUEGRWjJGmdGt8fP+8+ja1gVgzMYPIPaHWpXegcO1viIAaeu2H4QHESlVeHzUAHIxKXGrwjsyXAaA==",
"license": "MIT",
"peerDependencies": {
"echarts": "^6.0.0",
"vue": "^3.3.0"
}
},
"node_modules/vue3-apexcharts": {
"version": "1.11.1",
"resolved": "https://registry.npmjs.org/vue3-apexcharts/-/vue3-apexcharts-1.11.1.tgz",
"integrity": "sha512-MbN3vg8bMG19wc0Lm1HkeQvODgLm56DgpIxtNUO0xpf/JCzYWVGE4jzXp2JISzy2s3Kul1yOxNQUYsLvKQ5L9g==",
"license": "see LICENSE in LICENSE",
"peerDependencies": {
"apexcharts": ">=5.10.0",
"vue": ">=3.0.0"
},
"peerDependenciesMeta": {
"apexcharts": {
"optional": false
}
}
},
"node_modules/vuetify": { "node_modules/vuetify": {
"version": "4.0.5", "version": "4.0.5",
"resolved": "https://registry.npmjs.org/vuetify/-/vuetify-4.0.5.tgz", "resolved": "https://registry.npmjs.org/vuetify/-/vuetify-4.0.5.tgz",
@@ -4925,6 +5251,21 @@
"engines": { "engines": {
"node": ">=12" "node": ">=12"
} }
},
"node_modules/zrender": {
"version": "6.0.0",
"resolved": "https://registry.npmjs.org/zrender/-/zrender-6.0.0.tgz",
"integrity": "sha512-41dFXEEXuJpNecuUQq6JlbybmnHaqqpGlbH1yxnA5V9MMP4SbohSVZsJIwz+zdjQXSSlR1Vc34EgH1zxyTDvhg==",
"license": "BSD-3-Clause",
"dependencies": {
"tslib": "2.3.0"
}
},
"node_modules/zrender/node_modules/tslib": {
"version": "2.3.0",
"resolved": "https://registry.npmjs.org/tslib/-/tslib-2.3.0.tgz",
"integrity": "sha512-N82ooyxVNm6h1riLCoyS9e3fuJ3AMG2zIZs2Gd1ATcSFjSA23Q0fzjjZeh0jbJvWVDZ0cJT8yaNNaaXHzueNjg==",
"license": "0BSD"
} }
} }
} }
+7
View File
@@ -11,6 +11,7 @@
"@inertiajs/vue3": "^2.0.0", "@inertiajs/vue3": "^2.0.0",
"@tailwindcss/forms": "^0.5.3", "@tailwindcss/forms": "^0.5.3",
"@tailwindcss/vite": "^4.0.0", "@tailwindcss/vite": "^4.0.0",
"@types/leaflet": "^1.9.21",
"@types/node": "^25.5.0", "@types/node": "^25.5.0",
"@vitejs/plugin-vue": "^6.0.0", "@vitejs/plugin-vue": "^6.0.0",
"autoprefixer": "^10.4.12", "autoprefixer": "^10.4.12",
@@ -27,7 +28,13 @@
}, },
"dependencies": { "dependencies": {
"@mdi/font": "^7.4.47", "@mdi/font": "^7.4.47",
"apexcharts": "^5.10.5",
"chart.js": "^4.5.1",
"echarts": "^6.0.0",
"flag-icons": "^7.5.0", "flag-icons": "^7.5.0",
"maplibre-gl": "^5.22.0",
"vue-echarts": "^8.0.1",
"vue3-apexcharts": "^1.11.1",
"vuetify": "^4.0.5" "vuetify": "^4.0.5"
} }
} }
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

Some files were not shown because too many files have changed in this diff Show More