feat: create flight list and detail views with controllers

This commit is contained in:
2026-08-17 10:02:14 +03:30
parent 38cfe68c1b
commit 9215fb51c1
3 changed files with 518 additions and 0 deletions
+26
View File
@@ -0,0 +1,26 @@
<?php
namespace App\Http\Controllers;
use App\Enums\FlightStatus;
use App\Models\Flight;
use Illuminate\Http\Request;
class FlightController extends Controller
{
public function index()
{
$flights =Flight::applySort()
->where('status' , '=' , FlightStatus::AVAILABLE)
->paginate()
->withQueryString();
$title = 'پروازها';
return view('flights.index' , compact('title' , 'flights'));
}
public function show(Flight $flight)
{
$title = 'جزئیات پرواز';
return view('flights.show' , compact('title'));
}
}