From 4ddd8aa562bdea3b36a2b7e13b96673a755443dc Mon Sep 17 00:00:00 2001 From: Aji Kamaludin Date: Thu, 8 Jun 2023 18:03:06 +0700 Subject: [PATCH] bit fix --- app/Http/Controllers/Customer/HomeController.php | 2 +- app/Http/Controllers/LocationController.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/Http/Controllers/Customer/HomeController.php b/app/Http/Controllers/Customer/HomeController.php index 9ed4527..7f90af9 100644 --- a/app/Http/Controllers/Customer/HomeController.php +++ b/app/Http/Controllers/Customer/HomeController.php @@ -16,7 +16,7 @@ class HomeController extends Controller { $infos = Info::where('is_publish', 1)->orderBy('updated_at', 'desc')->get(); $banners = Banner::orderBy('updated_at', 'desc')->get(); - $locations = Location::get(); + $locations = Location::orderBy('updated_at', 'desc')->get(); $vouchers = Voucher::with(['location']) ->where('is_sold', Voucher::UNSOLD) ->groupBy('batch_id') diff --git a/app/Http/Controllers/LocationController.php b/app/Http/Controllers/LocationController.php index f8ed96b..af857cb 100644 --- a/app/Http/Controllers/LocationController.php +++ b/app/Http/Controllers/LocationController.php @@ -9,10 +9,10 @@ class LocationController extends Controller { public function index() { - $query = Location::paginate(); + $query = Location::orderBy('updated_at', 'desc'); return inertia('Location/Index', [ - 'query' => $query, + 'query' => $query->paginate(), ]); }