Files
airline-agency/app/Http/Controllers/FlightController.php
T

27 lines
623 B
PHP

<?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'));
}
}