git commit "update flight page"

This commit is contained in:
2026-08-17 10:01:42 +03:30
parent b626644eea
commit e99c340f1e
21 changed files with 13624 additions and 10781 deletions
+5 -9
View File
@@ -3,19 +3,15 @@
namespace App\Http\Controllers;
use App\Models\City;
use Illuminate\Http\Request;
class CityController extends Controller
{
//
public function getCities($province)
public function byProvince(int $province)
{
$cities = City::where('province_id',$province)
$cities = City::where('provinces', $province)
->orderBy('name')
->get();
->get(['id', 'name']);
return response()->json($cities);
}}
}
}
+14 -14
View File
@@ -2,29 +2,29 @@
namespace App\Http\Controllers;
use App\Http\Requests\FlightSearchRequest;
use App\Models\Flight;
use Illuminate\Http\Request;
class FlightController extends Controller
{
public function search(FlightSearchRequest $request)
public function index()
{
$filters = $request->validated();
$flights = Flight::query()
->applySearch($filters)
$newestFlight = Flight::
latest()
->applySearch()
->take(10)
->get();
$flights = Flight::latest()->
paginate(9);
return view('flights.search', compact('flights'));
return view('home.index', compact('newestFlight', 'flights'));
}
public function archive()
public function show(Flight $flight)
{
$flights = Flight::query()
->latest()
->paginate(12);
return view('flights.archive', compact('flights'));
$flight->increment('views');
return view('flights.show', compact('flight'));
}
}
}
+5 -8
View File
@@ -4,19 +4,16 @@ namespace App\Http\Controllers;
use App\Models\Flight;
use App\Models\Tour;
use App\Models\Province;
class HomeController extends Controller
{
public function index()
{
$flights = Flight::latest('created_at')
->take(6)
->get();
$newestFlight = Flight::latest()->take(10)->get();
$flights=Flight::latest()->paginate(5);
$newestTour = Tour::latest()->take(10)->get();
$tours = Tour::latest('created_at')
->take(6)
->get();
return view('home.index', compact('flights', 'tours'));
return view('home.index', compact('newestFlight','flights', 'newestTour'));
}
}
+25
View File
@@ -0,0 +1,25 @@
<?php
namespace App\Http\Controllers;
use App\Models\Tour;
class TourController extends Controller
{
// صفحه لیست تورها: اسلایدر آخرین‌ها + گرید صفحه‌بندی‌شده
public function index()
{
$newestTour = Tour::latest()->take(10)->get();
$tours = Tour::latest()->paginate(9);
return view('tours.index', compact('newestTour', 'tours'));
}
// جزئیات تور + شمارنده بازدید
public function show(Tour $tour)
{
$tour->increment('views');
return view('tours.show', compact('tour'));
}
}