From bee1e3a09a7c3de5e9ad0e1dbf593aa643acfc85 Mon Sep 17 00:00:00 2001 From: Mateja Date: Sun, 6 Dec 2020 23:54:38 +0100 Subject: Small improvements. --- app/Http/Controllers/LoginController.php | 2 +- app/Http/Controllers/ReservationsController.php | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) (limited to 'app') diff --git a/app/Http/Controllers/LoginController.php b/app/Http/Controllers/LoginController.php index 02779bf..be1de1d 100644 --- a/app/Http/Controllers/LoginController.php +++ b/app/Http/Controllers/LoginController.php @@ -44,7 +44,7 @@ class LoginController extends Controller //return redirect('login')->with('status', 'Submitted.'); //return Redirect::back()->with('status', 'Submitted.'); if (Auth::attempt($request->only('email', 'password'))) - return redirect()->intended(route('home')); + return redirect()->intended(route('reservations')); else return Redirect::back() ->withErrors(['failed' => ['Bad credentials!']]); } diff --git a/app/Http/Controllers/ReservationsController.php b/app/Http/Controllers/ReservationsController.php index 002645a..8f15105 100644 --- a/app/Http/Controllers/ReservationsController.php +++ b/app/Http/Controllers/ReservationsController.php @@ -170,7 +170,8 @@ class ReservationsController extends Controller ]); if ($request->input('call-sign') == 'all') { - $activities = Reservation::orderBy('id', 'desc') + $activities = Reservation::orderBy('fromTime', 'asc') + ->orderBy('toTime', 'asc') ->get() ->toArray(); $data = [ @@ -181,7 +182,8 @@ class ReservationsController extends Controller return response($data); } else { $activities = Reservation::where('specialCall', $request->input('call-sign')) - ->orderBy('id', 'desc') + ->orderBy('fromTime', 'asc') + ->orderBy('toTime', 'asc') ->get() ->toArray(); $data = [ -- cgit v1.2.3