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(), ]); }