feat: create flight list and detail views with controllers
This commit is contained in:
@@ -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'));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user