fix: fix tours and flights pagination on homepage

This commit is contained in:
2026-08-22 07:58:01 +03:30
parent fd6fbc4f93
commit ccdb811d2d
12 changed files with 1620 additions and 34 deletions
+6 -2
View File
@@ -2,6 +2,8 @@
namespace App\Http\Controllers;
use App\Enums\Flight\FlightStatus;
use App\Enums\Tour\TourStatus;
use App\Models\Flight;
use App\Models\Tour;
use Illuminate\Http\Request;
@@ -13,12 +15,14 @@ class IndexController extends Controller
{
$title = 'صفحه اصلی';
$flights = Flight::with('file')
->where('status', '=' , FlightStatus::AVAILABLE)
->orderByDesc('created_at')
->paginate(4);
->paginate(2, ['*'], 'flights_page');
$tours = Tour::with(['file' , 'originCity', 'city'])
->where('status', '=', TourStatus::AVAILABLE)
->orderByDesc('created_at')
->paginate(4);
->paginate(2, ['*'], 'tours_page');e(4);