aboutsummaryrefslogtreecommitdiff
path: root/resources
diff options
context:
space:
mode:
Diffstat (limited to 'resources')
-rw-r--r--resources/views/admin.blade.php46
-rw-r--r--resources/views/dashboard.blade.php34
-rw-r--r--resources/views/login.blade.php18
-rw-r--r--resources/views/register.blade.php19
4 files changed, 107 insertions, 10 deletions
diff --git a/resources/views/admin.blade.php b/resources/views/admin.blade.php
new file mode 100644
index 0000000..4140b13
--- /dev/null
+++ b/resources/views/admin.blade.php
@@ -0,0 +1,46 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <title>Admin</title>
+ <link rel="stylesheet" href="{{ asset('css/app.css') }}">
+</head>
+<body>
+@if(Auth::check())
+ <pre>Welcome admin!!</pre>
+@endif
+<h1>User List</h1>
+@if($players->isEmpty())
+ <p>No player found.</p>
+@else
+ <ul>
+ @foreach($players as $player)
+ <li>{{ $player->name }}</li>
+ @endforeach
+ </ul>
+@endif
+<form method="POST" action="/admin">
+ @csrf
+
+ <div>
+ <label for="name">user:</label>
+ <input name="name">
+ </div>
+
+ <div>
+ <label for="team">team:</label>
+ <input name="team">
+ </div>
+
+ @if($errors->any())
+ <div class="error">{{ $errors->first() }}</div>
+ @endif
+
+ <button type="submit">submit</button>
+</form>
+<form method="POST" action="/logout">
+ @csrf
+
+ <button type="submit">logout</button>
+</form>
+</body>
+</html>
diff --git a/resources/views/dashboard.blade.php b/resources/views/dashboard.blade.php
index 7001be3..6961cdb 100644
--- a/resources/views/dashboard.blade.php
+++ b/resources/views/dashboard.blade.php
@@ -1,17 +1,37 @@
- <ul>
- <li>name: {{ $player->name }}</li>
- <li>team: {{ $player->team }}</li>
- <li>score: {{ $player->score }}</li>
- </ul>
+<!DOCTYPE html>
+<html>
+<head>
+ <title>Dashboard</title>
+ <link rel="stylesheet" href="{{ asset('css/app.css') }}">
+</head>
+<body>
+@if(Auth::check())
+ <pre>You are logged in successfully</pre>
+@endif
+<ul>
+ <li>name: {{ $player->name }}</li>
+ <li>team: {{ $player->team }}</li>
+ <li>score: {{ $player->score }}</li>
+</ul>
-<form method="POST" action="/login/score">
+<form method="POST" action="/dashboard">
@csrf
- <input type="hidden" name="id" value="{{ $player->id }}">
<div>
<label for="score">Score:</label>
<input name="score">
</div>
+ @if($errors->any())
+ <div class="error">{{ $errors->first() }}</div>
+ @endif
+
<button type="submit">submit</button>
</form>
+<form method="POST" action="/logout">
+ @csrf
+
+ <button type="submit">logout</button>
+</form>
+</body>
+</html>
diff --git a/resources/views/login.blade.php b/resources/views/login.blade.php
index d5a528d..9f30bf7 100644
--- a/resources/views/login.blade.php
+++ b/resources/views/login.blade.php
@@ -1,3 +1,10 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <title>Login</title>
+ <link rel="stylesheet" href="{{ asset('css/app.css') }}">
+</head>
+<body>
<form method="POST" action="/login">
@csrf
@@ -6,5 +13,16 @@
<input name="name">
</div>
+ <div>
+ <label for="password">Password:</label>
+ <input type="password" name="password">
+ </div>
+
+ @if($errors->any())
+ <div class="error">{{ $errors->first() }}</div>
+ @endif
+
<button type="submit">login</button>
</form>
+</body>
+</html>
diff --git a/resources/views/register.blade.php b/resources/views/register.blade.php
index f526a43..b23dac0 100644
--- a/resources/views/register.blade.php
+++ b/resources/views/register.blade.php
@@ -1,15 +1,28 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <title>Register</title>
+ <link rel="stylesheet" href="{{ asset('css/app.css') }}">
+</head>
+<body>
<form method="POST" action="/register">
@csrf
<div>
<label for="name">Username:</label>
- <input name="name">
+ <input name="name" value="{{ old('name') }}">
</div>
<div>
- <label for="team">Team:</label>
- <input name="team">
+ <label for="password">Password:</label>
+ <input type="password" name="password" value="{{ old('password') }}">
</div>
+ @if($errors->any())
+ <div class="error">{{ $errors->first() }}</div>
+ @endif
+
<button type="submit">register</button>
</form>
+</body>
+</html>