From b5afd40a49a2c2b061865a501103ea2a060f4997 Mon Sep 17 00:00:00 2001 From: Mateja Date: Mon, 2 Nov 2020 15:25:36 +0100 Subject: Standardized controllers to CRUD... --- app/Http/Controllers/ReservationsController.php | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) (limited to 'app/Http/Controllers/ReservationsController.php') diff --git a/app/Http/Controllers/ReservationsController.php b/app/Http/Controllers/ReservationsController.php index 4816993..d3b141e 100644 --- a/app/Http/Controllers/ReservationsController.php +++ b/app/Http/Controllers/ReservationsController.php @@ -14,13 +14,26 @@ use App\Models\SpecialCall; class ReservationsController extends Controller { - public function reserve(Request $request) + public function index(Request $request) + { + $activities = Reservation::where('approved', '1')->get(); + //$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 create(Request $request) { $signs = SpecialCall::all(); return view('pages.reserve', compact('signs')); } - public function reserveForm(Request $request) + public function store(Request $request) { //$validatedData = $request->validate([ //... @@ -72,13 +85,13 @@ class ReservationsController extends Controller } // Administration - public function reservations(Request $request) + public function edit(Request $request) { $data = Reservation::all(); return view('pages.reservations', compact('data')); } - public function reservationsForm(Request $request) + public function update(Request $request) { return Redirect::back(); } -- cgit v1.2.3