diff options
author | Mateja <mail@matejamaric.com> | 2020-10-25 22:44:49 +0100 |
---|---|---|
committer | Mateja <mail@matejamaric.com> | 2020-10-25 22:44:49 +0100 |
commit | 7fa171e30a497cfccfd3aa7dbcbb4c60d2e51db9 (patch) | |
tree | 8255f2e5259554d6f87ce08a957fdd4c47e31973 | |
parent | dda8fb2a05de804f2b37245fde2580a9d18cc51b (diff) | |
download | yota-laravel-7fa171e30a497cfccfd3aa7dbcbb4c60d2e51db9.tar.gz yota-laravel-7fa171e30a497cfccfd3aa7dbcbb4c60d2e51db9.zip |
Work on activities and login page.
-rw-r--r-- | app/Http/Controllers/PagesController.php | 15 | ||||
-rw-r--r-- | resources/views/pages/activities.blade.php | 4 | ||||
-rw-r--r-- | resources/views/pages/login.blade.php | 15 | ||||
-rw-r--r-- | 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) <div class="table-responsive"> <table class="table table-striped table-bordered"><!-- table-hover --> <thead class="thead-dark"> @@ -10,4 +11,7 @@ </tbody> </table> </div> +@else +<p>There are currently no approved activities.</p> +@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')) + <div class="alert alert-success"> + {{ session('status') }} + </div> +@endif <form action="{{ route('login') }}" method="POST"> @csrf <div class="form-group"> <label for="email">Email: </label> - <input class="form-control" type="email" id="email" name="email"> + <input class="form-control @error('email') is-invalid @enderror" type="email" id="email" name="email"> + @error('email') + <div class="alert alert-danger mt-2">{{ $message }}</div> + @enderror </div> <div class="form-group"> <label for="pw">Password: </label> - <input class="form-control" type="password" id="pw" name="password"> + <input class="form-control @error('password') is-invalid @enderror" type="password" id="pw" name="password"> + @error('password') + <div class="alert alert-danger mt-2">{{ $message }}</div> + @enderror </div> <div class="form-group"> <input class="btn btn-primary" type="submit" value="Login"> 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'); |