fix: fix tours and flights pagination on homepage
This commit is contained in:
@@ -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);
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user