From 2140f96e655d71c4f388ff102babd306bcaad218 Mon Sep 17 00:00:00 2001 From: Mateja Date: Sat, 31 Oct 2020 21:10:32 +0100 Subject: Don't use foreign keys for special calls. --- app/Http/Controllers/SpecialCallsController.php | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) (limited to 'app/Http/Controllers') diff --git a/app/Http/Controllers/SpecialCallsController.php b/app/Http/Controllers/SpecialCallsController.php index 421e85d..2f3282d 100644 --- a/app/Http/Controllers/SpecialCallsController.php +++ b/app/Http/Controllers/SpecialCallsController.php @@ -17,20 +17,21 @@ class SpecialCallsController extends Controller { public function activities(Request $request) { - //$activities = Reservation::all(); - $activities = Reservation::addSelect([ - 'specialCall' => SpecialCall::select('sign') - //->whereColumn('reservations.specialCall', 'special_calls.id') - ->whereColumn('specialCall', 'id') - ->limit(1) - ])->get(); + $activities = Reservation::all(); + //$activities = Reservation::addSelect([ + //'specialCall' => SpecialCall::select('sign') + ////->whereColumn('reservations.specialCall', 'special_calls.id') + //->whereColumn('specialCall', 'id') + //->limit(1) + //])->get(); return view('pages.activities', compact('activities')); } public function reserve(Request $request) { - return view('pages.reserve'); + $signs = SpecialCall::all(); + return view('pages.reserve', compact('signs')); } public function reserveForm(Request $request) @@ -79,7 +80,7 @@ class SpecialCallsController extends Controller $reservation = new Reservation(); - $reservation->specialCall = 2; + $reservation->specialCall = $request->scall; $reservation->fromTime = $request->sdate . ' ' . $request->stime; $reservation->toTime = $request->edate . ' ' . $request->etime; $reservation->frequencies = implode(', ', $request->freqs); -- cgit v1.2.3