User can add/edit flights

This commit is contained in:
2026-04-12 20:34:22 +10:00
parent 0f84ec023e
commit a9aa65f0d2
12 changed files with 266 additions and 20 deletions
+5 -8
View File
@@ -37,13 +37,10 @@ Route::domain(config('app.domain'))->group(
return Inertia::render('Fr24Import');
})->name('import.fr24');
Route::get('/add-flight', function () {
return Inertia::render('AddFlight', [
'seat_types' => SeatType::all()->map(fn ($s) => ['value' => $s->id, 'title' => $s->name]),
'flight_reasons' => FlightReason::all()->map(fn ($f) => ['value' => $f->id, 'title' => $f->name]),
'flight_classes' => FlightClass::all()->map(fn ($f) => ['value' => $f->id, 'title' => $f->name]),
]);
});
Route::post('/flights', [FlightController::class, 'store'])->name('flights.store');
Route::get('/flights/add', [FlightController::class, 'add'])->name('flights.add');
Route::get('/flights/{flight}/edit', [FlightController::class, 'edit'])->name('flights.edit');
Route::put('/flights/{flight}', [FlightController::class, 'update'])->name('flights.update');
Route::get('/reconcile', function () {
$flight = new FlightImportController()->reconcile(request());
@@ -74,7 +71,7 @@ Route::domain(config('app.domain'))->group(
Route::get('/search/airports', [SearchController::class, 'airports'])->name('search.airports');
Route::get('/u/{username}', [FlightProfileController::class, 'view']);
Route::get('/u/{username}', [FlightProfileController::class, 'view'])->name('profile.view');
require __DIR__.'/auth.php';