From 60177901c6470e45ef7bcf7539640a03c6bbfa55 Mon Sep 17 00:00:00 2001 From: tschneider Date: Thu, 11 Feb 2021 10:34:05 +0100 Subject: [PATCH] TourController: Touren nach Datum sortieren (orderBy) --- motorradig/app/Http/Controllers/TourController.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/motorradig/app/Http/Controllers/TourController.php b/motorradig/app/Http/Controllers/TourController.php index 247c5b5..d67d147 100644 --- a/motorradig/app/Http/Controllers/TourController.php +++ b/motorradig/app/Http/Controllers/TourController.php @@ -23,7 +23,7 @@ class TourController extends Controller public function index() { error_log("Tour:index"); - $tours=Tour::where('start','>',Carbon::now())->get(); + $tours=Tour::where('start','>',Carbon::now())->orderBy('start')->get(); $participantCount=array(); foreach($tours as $tour) { $result = DB::select('select count(*) as cnt from bookings where tour_id=?', [$tour->id]); @@ -35,7 +35,7 @@ class TourController extends Controller public function index_old() { error_log("Tour:index_old"); - $tours=Tour::where('start','<',Carbon::now())->get(); + $tours=Tour::where('start','<',Carbon::now())->orderBy('start')->get(); $participantCount=array(); foreach($tours as $tour) { $result = DB::select('select count(*) as cnt from bookings where tour_id=?', [$tour->id]);