git commit "Complete today's development"
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\Http\Requests\FlightSearchRequest;
|
||||
use App\Models\Flight;
|
||||
|
||||
class FlightController extends Controller
|
||||
{
|
||||
public function search(FlightSearchRequest $request)
|
||||
{
|
||||
$filters = $request->validated();
|
||||
|
||||
$flights = Flight::query()
|
||||
->applySearch($filters)
|
||||
->get();
|
||||
|
||||
return view('flights.search', compact('flights'));
|
||||
}
|
||||
|
||||
public function archive()
|
||||
{
|
||||
$flights = Flight::query()
|
||||
->latest()
|
||||
->paginate(12);
|
||||
|
||||
return view('flights.archive', compact('flights'));
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user