Skip to content

Commit

Permalink
Added contact page and routes
Browse files Browse the repository at this point in the history
  • Loading branch information
Raccoon254 committed May 26, 2024
1 parent b674c6c commit 54feed3
Show file tree
Hide file tree
Showing 6 changed files with 80 additions and 23 deletions.
5 changes: 5 additions & 0 deletions app/Http/Controllers/PagesController.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,9 @@ public function dashboard(): View
{
return view('dashboard');
}

public function contact(): View
{
return view('contact');
}
}
2 changes: 1 addition & 1 deletion resources/css/app.css
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
input:-webkit-autofill:active {
input:-webkit-autofill:active, textarea {
-webkit-box-shadow: 0 0 0 1000px white inset;
box-shadow: 0 0 0 1000px white inset;
-webkit-text-fill-color: #000;
Expand Down
48 changes: 48 additions & 0 deletions resources/views/contact.blade.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
<!DOCTYPE html>
<html lang="{{ str_replace('_', '-', app()->getLocale()) }}">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">

<title>
@yield('title', 'Scholarspace|contact us page')
</title>

<!-- Fonts -->
<link rel="preconnect" href="https://fonts.bunny.net">
<link href="https://fonts.bunny.net/css?family=figtree:400,600&display=swap" rel="stylesheet"/>
@vite(['resources/css/app.css', 'resources/js/app.js'])
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/all.min.css">

</head>
<body class="font-sans antialiased">
@include('layouts.navigation.logged-out')
<div class="bg-gray-50 h-[90vh]">
<div class="container mx-auto py-12 px-4 sm:px-6 lg:px-8">
<div class="flex px-1 sm:px-4 lg:px-8 flex-col md:flex-row items-center justify-between">
<h1 class="text-4xl font-bold text-black/90 leading-snug">
Contact Us
</h1>
<form method="POST" action="{{ route('contact.submit') }}">
@csrf
<div>
<label for="name">Name</label>
<x-text-input :name="'name'" :required="true"/>
</div>
<div>
<label for="email">Email</label>
<x-text-input :name="'email'" :required="true"/>
</div>
<div>
<label for="message">Message</label>
<textarea name="message" id="message" cols="30" rows="6" class="w-full textarea bg-white border border-gray-300 rounded-lg shadow-sm"></textarea>
</div>
<div class="mt-4">
<button class="custom-btn w-full" type="submit">Submit</button>
</div>
</form>
</div>
</div>
</div>
</body>
</html>
23 changes: 23 additions & 0 deletions resources/views/layouts/navigation/logged-out.blade.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<nav class="bg-gray-100">
<div class="container mx-auto px-4 sm:px-6 lg:px-8 py-4">
<div class="flex justify-between items-center">
<a href="#" class="text-2xl font-bold text-black/90">Scholarspace</a>
<div class="hidden md:flex items-center space-x-4">
<a href="#" class="text-black/50 hover:text-black">How It Works</a>
<a href="#" class="text-black/50 hover:text-black">Services</a>
<a href="#" class="text-black/50 hover:text-black">About Us</a>
<a href="{{ route('contact') }}"
class="text-black/50 hover:text-black">Contact</a>
<a href="{{ route('login') }}"
class="bg-blue-500 text-white/90 hover:bg-blue-600 font-semibold py-2 px-4 rounded-md">Login</a>
<a href="{{ route('register') }}"
class="bg-green-500 text-black/90 hover:bg-green-600 font-semibold py-2 px-4 rounded-md">Register</a>
</div>
<div class="md:hidden">
<button>
<i class="fas fa-bars"></i>
</button>
</div>
</div>
</div>
</nav>
23 changes: 1 addition & 22 deletions resources/views/welcome.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,28 +14,7 @@

</head>
<body class="font-sans antialiased">
<nav class="bg-gray-100">
<div class="container mx-auto px-4 sm:px-6 lg:px-8 py-4">
<div class="flex justify-between items-center">
<a href="#" class="text-2xl font-bold text-black/90">Scholarspace</a>
<div class="hidden md:flex items-center space-x-4">
<a href="#" class="text-black/50 hover:text-black">How It Works</a>
<a href="#" class="text-black/50 hover:text-black">Services</a>
<a href="#" class="text-black/50 hover:text-black">About Us</a>
<a href="#" class="text-black/50 hover:text-black">Contact</a>
<a href="{{ route('login') }}"
class="bg-blue-500 text-white/90 hover:bg-blue-600 font-semibold py-2 px-4 rounded-md">Login</a>
<a href="{{ route('register') }}"
class="bg-green-500 text-black/90 hover:bg-green-600 font-semibold py-2 px-4 rounded-md">Register</a>
</div>
<div class="md:hidden">
<button>
<i class="fas fa-bars"></i>
</button>
</div>
</div>
</div>
</nav>
@include('layouts.navigation.logged-out')
<div class="bg-gray-50">
<div class="container mx-auto py-12 px-4 sm:px-6 lg:px-8">
<div class="flex px-1 sm:px-4 lg:px-8 flex-col md:flex-row items-center justify-between">
Expand Down
2 changes: 2 additions & 0 deletions routes/web.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,6 @@
Route::get('/users', ManageUsers::class)->name('users.index');
});

Route::get('/contact', [PagesController::class, 'contact'])->name('contact');
Route::post('/contact', [PagesController::class, 'contact_submit'])->name('contact.submit');
require __DIR__.'/auth.php';

0 comments on commit 54feed3

Please sign in to comment.