-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
22 changed files
with
254 additions
and
112 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<?php | ||
namespace App\Http\Middleware; | ||
|
||
use Closure; | ||
use Illuminate\Support\Facades\Auth; | ||
|
||
class CheckUserLoggedIn | ||
{ | ||
/** | ||
* Handle an incoming request. | ||
* | ||
* @param \Illuminate\Http\Request $request | ||
* @param \Closure $next | ||
* @return mixed | ||
*/ | ||
public function handle($request, Closure $next) | ||
{ | ||
if (!Auth::check()) { | ||
return redirect()->route('login'); // Redirect to the login page if not authenticated | ||
} | ||
|
||
return $next($request); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
@tailwind base; | ||
@tailwind components; | ||
@tailwind utilities; | ||
@tailwind utilities; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,46 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
|
||
<head> | ||
<meta charset="UTF-8"> | ||
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<title>Mister Quiz</title> | ||
|
||
<!-- Tailwind CSS --> | ||
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/tailwind.min.css" rel="stylesheet"> | ||
|
||
<!-- Boxicons CSS --> | ||
<link href='https://unpkg.com/[email protected]/css/boxicons.min.css' rel='stylesheet'> | ||
|
||
<!-- Custom CSS (if needed) --> | ||
<link type="text/css" rel="stylesheet" href="{{ asset('css/app.css') }}"> | ||
</head> | ||
|
||
<body> | ||
<nav class="bg-gray-800 p-4"> | ||
<div class="container mx-auto flex justify-between items-center"> | ||
<a class="text-white hover:bg-gray-700 p-2 rounded" href="{{ route('home') }}">Home</a> | ||
|
||
@auth | ||
<div class="flex space-x-4"> | ||
<a class="text-white hover:bg-gray-700 p-2 rounded" href="{{ route('profile') }}">{{ auth()->user()->username }}</a> | ||
<form action="{{ route('logout') }}" method="POST" class="inline"> | ||
@csrf | ||
<button type="submit" class="text-white hover:bg-gray-700 p-2 rounded">Logout</button> | ||
</form> | ||
</div> | ||
@endauth | ||
|
||
@guest | ||
<div class="flex space-x-4"> | ||
<a class="text-white hover:bg-gray-700 p-2 rounded" href="{{ route('register') }}">Register</a> | ||
<a class="text-white hover:bg-gray-700 p-2 rounded" href="{{ route('login') }}">Login</a> | ||
</div> | ||
@endguest | ||
|
||
<a class="text-white hover:bg-gray-700 p-2 rounded" href="{{ route('leaderboard') }}">Leaderboard</a> | ||
</div> | ||
</nav> | ||
|
||
@yield('content') | ||
</body> | ||
|
||
</html> | ||
</html> |
Oops, something went wrong.