From 7fa171e30a497cfccfd3aa7dbcbb4c60d2e51db9 Mon Sep 17 00:00:00 2001 From: Mateja Date: Sun, 25 Oct 2020 22:44:49 +0100 Subject: Work on activities and login page. --- app/Http/Controllers/PagesController.php | 15 +++++++++++++++ resources/views/pages/activities.blade.php | 4 ++++ resources/views/pages/login.blade.php | 15 +++++++++++++-- routes/web.php | 1 + 4 files changed, 33 insertions(+), 2 deletions(-) diff --git a/app/Http/Controllers/PagesController.php b/app/Http/Controllers/PagesController.php index 1e0866f..3955254 100644 --- a/app/Http/Controllers/PagesController.php +++ b/app/Http/Controllers/PagesController.php @@ -87,6 +87,21 @@ class PagesController extends Controller return redirect('reserve')->with('status', 'Reservation submitted.'); } + /** + * undocumented function + * + * @return void + */ + public function loginForm(Request $request) + { + $validatedData = $request->validate([ + 'email' => 'required|email', + 'password' => 'required', + ]); + return redirect('login')->with('status', 'Submitted.'); + } + + //public function services() //{ ////$title = 'Some title'; diff --git a/resources/views/pages/activities.blade.php b/resources/views/pages/activities.blade.php index 6232a0c..03319fc 100644 --- a/resources/views/pages/activities.blade.php +++ b/resources/views/pages/activities.blade.php @@ -1,6 +1,7 @@ @extends('layouts.app') @section('content') +@if (1==2)
@@ -10,4 +11,7 @@
+@else +

There are currently no approved activities.

+@endif @endsection() diff --git a/resources/views/pages/login.blade.php b/resources/views/pages/login.blade.php index f75fb78..4c21ae5 100644 --- a/resources/views/pages/login.blade.php +++ b/resources/views/pages/login.blade.php @@ -1,15 +1,26 @@ @extends('layouts.app') @section('content') +@if (session('status')) +
+ {{ session('status') }} +
+@endif
@csrf
- + + @error('email') +
{{ $message }}
+ @enderror
- + + @error('password') +
{{ $message }}
+ @enderror
diff --git a/routes/web.php b/routes/web.php index cbbbc27..0d42dc9 100644 --- a/routes/web.php +++ b/routes/web.php @@ -39,6 +39,7 @@ Route::get('/reserve', [PagesController::class, 'reserve'])->name('reserve'); Route::post('/reserve', [PagesController::class, 'reserveForm'])->name('reserveForm'); Route::get('/login', [PagesController::class, 'login'])->name('login'); +Route::post('/login', [PagesController::class, 'loginForm'])->name('loginForm'); //Route::get('/about', [PagesController::class, 'about'])->name('about'); //Route::get('/about', 'App\Http\Controllers\PagesController@about'); -- cgit v1.2.3