From dda8fb2a05de804f2b37245fde2580a9d18cc51b Mon Sep 17 00:00:00 2001 From: Mateja Date: Sun, 25 Oct 2020 22:18:23 +0100 Subject: Form validation, blade, bootstrap --- app/Http/Controllers/PagesController.php | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) (limited to 'app') diff --git a/app/Http/Controllers/PagesController.php b/app/Http/Controllers/PagesController.php index fcdfba9..1e0866f 100644 --- a/app/Http/Controllers/PagesController.php +++ b/app/Http/Controllers/PagesController.php @@ -52,6 +52,38 @@ class PagesController extends Controller public function reserveForm(Request $request) { //dd($request->input('modes')); + + $validatedData = $request->validate([ + 'scall' => 'required|alphanum', + 'sdate' => 'required|date', + 'stime' => 'required', + 'edate' => 'required|date', + 'etime' => 'required', + 'freqs' => 'required', + 'modes' => 'required', + 'ocall' => 'required|alphanum', + 'oname' => 'required', + 'email' => 'required|email', + 'phone' => ['required', 'regex:/^[0-9 ]+$/'], + ]); + +/* + $table->id(); + $table->boolean('approved')->default(false); + $table->unsignedBigInteger('specialCall'); + $table->dateTime('fromTime'); + $table->dateTime('toTime'); + $table->string('frequencies', 255); + $table->string('modes', 255); + $table->string('operatorCall'); + $table->string('operatorName'); + $table->string('operatorEmail'); + $table->string('operatorPhone', 50); + $table->integer('qso')->default(0); + $table->timestamps(); + $table->foreign('specialCall')->references('id')->on('special_calls'); +*/ + return redirect('reserve')->with('status', 'Reservation submitted.'); } -- cgit v1.2.3