aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMateja <mail@matejamaric.com>2020-10-31 11:17:51 +0100
committerMateja <mail@matejamaric.com>2020-10-31 11:17:51 +0100
commit27499b34d0263e4e7429292517acb8d37ee2c8d2 (patch)
tree08da40f21af8ee61e03f2f47a5d5ae2d952b15ac
parent28d2635b53441c00be130a82b37a08e2895e889d (diff)
downloadyota-laravel-27499b34d0263e4e7429292517acb8d37ee2c8d2.tar.gz
yota-laravel-27499b34d0263e4e7429292517acb8d37ee2c8d2.zip
Add SpecialCallsController and titles to views.
-rw-r--r--app/Http/Controllers/PagesController.php52
-rw-r--r--app/Http/Controllers/SpecialCallsController.php43
-rw-r--r--resources/views/layouts/app.blade.php2
-rw-r--r--resources/views/pages/activities.blade.php2
-rw-r--r--resources/views/pages/callsigns.blade.php2
-rw-r--r--resources/views/pages/gallery.blade.php2
-rw-r--r--resources/views/pages/index.blade.php2
-rw-r--r--resources/views/pages/login.blade.php2
-rw-r--r--resources/views/pages/news.blade.php2
-rw-r--r--resources/views/pages/reservations.blade.php2
-rw-r--r--resources/views/pages/reserve.blade.php2
-rw-r--r--resources/views/pages/sponsoring.blade.php2
-rw-r--r--routes/web.php8
13 files changed, 79 insertions, 44 deletions
diff --git a/app/Http/Controllers/PagesController.php b/app/Http/Controllers/PagesController.php
index f42ae3e..c30f923 100644
--- a/app/Http/Controllers/PagesController.php
+++ b/app/Http/Controllers/PagesController.php
@@ -18,11 +18,6 @@ class PagesController extends Controller
return view('pages.index');
}
- public function sponsoring(Request $request)
- {
- return view('pages.sponsoring');
- }
-
public function news(Request $request)
{
$news = Post::all();
@@ -36,44 +31,15 @@ class PagesController extends Controller
return view('pages.gallery');
}
- public function login(Request $request)
- {
- return view('pages.login');
- }
-
- public function logout(Request $request)
- {
- Auth::logout();
- return Redirect::back();
- }
-
- public function activities(Request $request)
- {
- return view('pages.activities');
- }
-
- public function reserve(Request $request)
+ public function sponsoring(Request $request)
{
- return view('pages.reserve');
+ return view('pages.sponsoring');
}
- public function reserveForm(Request $request)
+ // LOGIN SYSTEM
+ public function login(Request $request)
{
- $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 ]+$/'],
- ]);
-
- return redirect('reserve')->with('status', 'Reservation submitted.');
+ return view('pages.login');
}
public function loginForm(Request $request)
@@ -107,8 +73,14 @@ class PagesController extends Controller
else return Redirect::back()
->withErrors(['failed' => ['Bad credentials!']]);
}
-
+ public function logout(Request $request)
+ {
+ Auth::logout();
+ return Redirect::back();
+ }
+
+ // NOTES
//public function services()
//{
////$title = 'Some title';
diff --git a/app/Http/Controllers/SpecialCallsController.php b/app/Http/Controllers/SpecialCallsController.php
new file mode 100644
index 0000000..3a3ab89
--- /dev/null
+++ b/app/Http/Controllers/SpecialCallsController.php
@@ -0,0 +1,43 @@
+<?php
+
+namespace App\Http\Controllers;
+
+use Illuminate\Http\Request;
+use function dd;
+use function redirect;
+
+use Illuminate\Support\Facades\Validator;
+use Illuminate\Support\Facades\Redirect;
+use Illuminate\Support\Facades\Auth;
+
+class SpecialCallsController extends Controller
+{
+ public function activities(Request $request)
+ {
+ return view('pages.activities');
+ }
+
+ public function reserve(Request $request)
+ {
+ return view('pages.reserve');
+ }
+
+ public function reserveForm(Request $request)
+ {
+ $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 ]+$/'],
+ ]);
+
+ return redirect('reserve')->with('status', 'Reservation submitted.');
+ }
+}
diff --git a/resources/views/layouts/app.blade.php b/resources/views/layouts/app.blade.php
index 13e2c6a..07b8d8a 100644
--- a/resources/views/layouts/app.blade.php
+++ b/resources/views/layouts/app.blade.php
@@ -8,7 +8,7 @@
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css" integrity="sha384-JcKb8q3iqJ61gNV9KGb8thSsNjpSL0n8PARn9HuZOnIxN0hoP+VmmDGMN5t9UJ0Z" crossorigin="anonymous">
- <title>Main page</title>
+ <title>YOTA - @yield('title')</title>
</head>
<body>
@include('inc.navbar')
diff --git a/resources/views/pages/activities.blade.php b/resources/views/pages/activities.blade.php
index 6521759..ac2b04d 100644
--- a/resources/views/pages/activities.blade.php
+++ b/resources/views/pages/activities.blade.php
@@ -1,5 +1,7 @@
@extends('layouts.app')
+@section('title', 'Special Calls - Activities')
+
@section('content')
@if (1==2)
<div class="table-responsive">
diff --git a/resources/views/pages/callsigns.blade.php b/resources/views/pages/callsigns.blade.php
index 2afe0dd..10cea68 100644
--- a/resources/views/pages/callsigns.blade.php
+++ b/resources/views/pages/callsigns.blade.php
@@ -1,5 +1,7 @@
@extends('layouts.app')
+@section('title', 'Callsigns administration')
+
@section('content')
<strong>CALLSIGNS ADMINISTRATION</strong>
@endsection
diff --git a/resources/views/pages/gallery.blade.php b/resources/views/pages/gallery.blade.php
index c566186..84b8daf 100644
--- a/resources/views/pages/gallery.blade.php
+++ b/resources/views/pages/gallery.blade.php
@@ -1,5 +1,7 @@
@extends('layouts.app')
+@section('title', 'Gallery')
+
@section('content')
<div class="row">
<img class="col-lg-6 mb-3 mb-lg-0" src="/imgs/camp.png" alt="YOTA camp"/>
diff --git a/resources/views/pages/index.blade.php b/resources/views/pages/index.blade.php
index eeb7b56..22e6a6c 100644
--- a/resources/views/pages/index.blade.php
+++ b/resources/views/pages/index.blade.php
@@ -1,5 +1,7 @@
@extends('layouts.app')
+@section('title', 'Home')
+
@section('jumbotron')
{{--<div class="jumbotron jumbotron-fluid bg-cover" style="background-image: url('/imgs/yota.jpg'); background-size: cover; background-repeat: no-repeat;">--}}
<div class="jumbotron">
diff --git a/resources/views/pages/login.blade.php b/resources/views/pages/login.blade.php
index 473c23f..3fbc995 100644
--- a/resources/views/pages/login.blade.php
+++ b/resources/views/pages/login.blade.php
@@ -1,5 +1,7 @@
@extends('layouts.app')
+@section('title', 'Login')
+
@section('content')
@if (session('status'))
<div class="alert alert-success">
diff --git a/resources/views/pages/news.blade.php b/resources/views/pages/news.blade.php
index 5e4453f..44d0202 100644
--- a/resources/views/pages/news.blade.php
+++ b/resources/views/pages/news.blade.php
@@ -1,5 +1,7 @@
@extends('layouts.app')
+@section('title', 'News')
+
@section('content')
@foreach($news as $post)
<div class="well">
diff --git a/resources/views/pages/reservations.blade.php b/resources/views/pages/reservations.blade.php
index 3901ed0..a444f55 100644
--- a/resources/views/pages/reservations.blade.php
+++ b/resources/views/pages/reservations.blade.php
@@ -1,5 +1,7 @@
@extends('layouts.app')
+@section('title', 'Reservations')
+
@section('content')
<div class="table-responsive">
<table class="table table-striped table-bordered"><!-- table-hover -->
diff --git a/resources/views/pages/reserve.blade.php b/resources/views/pages/reserve.blade.php
index 163fea0..f0d6fe8 100644
--- a/resources/views/pages/reserve.blade.php
+++ b/resources/views/pages/reserve.blade.php
@@ -1,5 +1,7 @@
@extends('layouts.app')
+@section('title', 'Make reservation')
+
@section('content')
@if (session('status'))
<div class="alert alert-success">
diff --git a/resources/views/pages/sponsoring.blade.php b/resources/views/pages/sponsoring.blade.php
index 4b79934..cf2a872 100644
--- a/resources/views/pages/sponsoring.blade.php
+++ b/resources/views/pages/sponsoring.blade.php
@@ -1,5 +1,7 @@
@extends('layouts.app')
+@section('title', 'Sponsoring')
+
@section('content')
<p>If you are willing to be one of the sponsors of the event and help us set the high standards for Balkan YOTA camp, feel free to contact Goran YT7AW hajosevic at gmail . com</p>
<p>As part of the camp and presentations will be dedicated to already experienced HAM radio operators, this is a great opportunity to present your company and products in the region. Additionally a banner and link to your website will be made available here.</p>
diff --git a/routes/web.php b/routes/web.php
index 7a156a4..4c20032 100644
--- a/routes/web.php
+++ b/routes/web.php
@@ -2,6 +2,7 @@
use Illuminate\Support\Facades\Route;
use App\Http\Controllers\PagesController;
+use App\Http\Controllers\SpecialCallsController;
/*
|--------------------------------------------------------------------------
@@ -34,9 +35,10 @@ Route::get('/', [PagesController::class, 'index'])->name('home');
Route::get('/news', [PagesController::class, 'news'])->name('news');
Route::get('/gallery', [PagesController::class, 'gallery'])->name('gallery');
Route::get('/sponsoring', [PagesController::class, 'sponsoring'])->name('sponsoring');
-Route::get('/activities', [PagesController::class, 'activities'])->name('activities');
-Route::get('/reserve', [PagesController::class, 'reserve'])->name('reserve');
-Route::post('/reserve', [PagesController::class, 'reserveForm'])->name('reserveForm');
+
+Route::get('/special-calls', [SpecialCallsController::class, 'activities'])->name('activities');
+Route::get('/special-calls/reserve', [SpecialCallsController::class, 'reserve'])->name('reserve');
+Route::post('/special-calls/reserve', [SpecialCallsController::class, 'reserveForm'])->name('reserveForm');
Route::get('/login', [PagesController::class, 'login'])->name('login');
Route::post('/login', [PagesController::class, 'loginForm'])->name('loginForm');