diff --git a/app/Http/Controllers/AuthController.php b/app/Http/Controllers/AuthController.php
new file mode 100644
index 0000000..446e291
--- /dev/null
+++ b/app/Http/Controllers/AuthController.php
@@ -0,0 +1,91 @@
+validate([
+ 'first_name' => 'required|string|max:255',
+ 'last_name' => 'required|string|max:255',
+ 'email' => 'required|string|email|max:255|unique:users',
+ 'phone' => 'required|string|max:15',
+ 'password' => 'required|string|min:8|confirmed',
+ ]);
+
+ $user = User::create([
+ 'first_name' => $request->first_name,
+ 'last_name' => $request->last_name,
+ 'email' => $request->email,
+ 'phone' => $request->phone,
+ 'password' => Hash::make($request->password),
+ ]);
+
+ // Automatically logs the new user in
+ Auth::login($user);
+
+ // FIX: Changed redirect from '/signin' to '/' because they are already logged in
+ return redirect('/')->with('success', 'Registration successful! Welcome to your dashboard.');
+ }
+
+ /**
+ * Handle Student Login (POST)
+ */
+ public function login(Request $request)
+ {
+ $credentials = $request->validate([
+ 'email' => 'required|email',
+ 'password' => 'required|string',
+ ]);
+
+ if (Auth::attempt($credentials)) {
+ $request->session()->regenerate();
+
+ return redirect()->intended('/')->with('success', 'Welcome back!');
+ }
+
+ return back()->withErrors([
+ 'email' => 'The provided credentials do not match our records.',
+ ])->onlyInput('email');
+ }
+
+ /**
+ * Handle Async Logout (POST Fetch)
+ */
+ public function logout(Request $request) // FIX: Restored Request injection
+ {
+ try {
+ if (Auth::check()) {
+ Auth::logout();
+ }
+
+ // Flush old fallback explicit keys
+ $request->session()->forget(['user_id', 'user_name']);
+
+ if ($request->session()->isStarted()) {
+ $request->session()->invalidate();
+ $request->session()->regenerateToken();
+ }
+
+ return response()->json(['success' => true]);
+
+ } catch (\Exception $e) {
+ Log::error('Logout Server Error: ' . $e->getMessage());
+
+ if (isset($_SESSION)) {
+ session_destroy();
+ }
+ return response()->json(['success' => true, 'forced' => true]);
+ }
+ }
+}
\ No newline at end of file
diff --git a/app/Models/User.php b/app/Models/User.php
index 68f3a66..414254f 100644
--- a/app/Models/User.php
+++ b/app/Models/User.php
@@ -18,11 +18,13 @@ class User extends Authenticatable
*
* @var list
*/
- protected $fillable = [
- 'name',
- 'email',
- 'password',
- ];
+ protected $fillable = [
+ 'first_name',
+ 'last_name',
+ 'email',
+ 'phone',
+ 'password',
+];
/**
* The attributes that should be hidden for serialization.
diff --git a/database/migrations/0001_01_01_000000_create_users_table.php b/database/migrations/0001_01_01_000000_create_users_table.php
index 05fb5d9..24a159b 100644
--- a/database/migrations/0001_01_01_000000_create_users_table.php
+++ b/database/migrations/0001_01_01_000000_create_users_table.php
@@ -13,8 +13,10 @@ return new class extends Migration
{
Schema::create('users', function (Blueprint $table) {
$table->id();
- $table->string('name');
+ $table->string('first_name');
+ $table->string('last_name');
$table->string('email')->unique();
+ $table->string('phone');
$table->timestamp('email_verified_at')->nullable();
$table->string('password');
$table->rememberToken();
@@ -46,4 +48,4 @@ return new class extends Migration
Schema::dropIfExists('password_reset_tokens');
Schema::dropIfExists('sessions');
}
-};
+};
\ No newline at end of file
diff --git a/resources/views/abouts.blade.php b/resources/views/abouts.blade.php
index 9722d33..b434d7c 100644
--- a/resources/views/abouts.blade.php
+++ b/resources/views/abouts.blade.php
@@ -163,9 +163,12 @@ Industry-recognized certifications to boost your career.
Join our institute and become a skilled automotive professional.
-
-Student Portal
-
+
+
+
diff --git a/resources/views/apply.blade.php b/resources/views/apply.blade.php
index 82abfcd..1065686 100644
--- a/resources/views/apply.blade.php
+++ b/resources/views/apply.blade.php
@@ -46,7 +46,7 @@
}
.form-header {
- background: var(--primary);
+ background: #887582;
color: white;
padding: 25px 40px;
}
@@ -57,7 +57,7 @@
}
.section-title {
- background: #0B3B70;
+ background: #887582;
color: white;
padding: 14px 20px;
margin-top: 40px;
@@ -138,7 +138,19 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -159,13 +172,36 @@
-
+
+
+
+
+
+ Education
+
+
+
+
+
+
+
+
+
+
+
+
Qualifications
-
Emergency Contacts
diff --git a/resources/views/contacts.blade.php b/resources/views/contacts.blade.php
index 32096ce..b947e78 100644
--- a/resources/views/contacts.blade.php
+++ b/resources/views/contacts.blade.php
@@ -40,7 +40,7 @@
.btn-contact{
background:var(--primary);
color:#fff;
- border-radius:30px;
+ /* border-radius:30px; */
padding:10px 30px;
}
@@ -153,15 +153,25 @@ Send Message
diff --git a/resources/views/courses.blade.php b/resources/views/courses.blade.php
index ab90780..1e39be2 100644
--- a/resources/views/courses.blade.php
+++ b/resources/views/courses.blade.php
@@ -11,14 +11,24 @@
--light:#f8f4f7;
}
-.hero{
+/* .hero{
background:linear-gradient(rgba(0,0,0,.65),rgba(0,0,0,.65)),
- url('https://images.unsplash.com/photo-1492144534655-ae79c964c9d7?auto=format&fit=crop&w=1600&q=80');
+ url(https://images.unsplash.com/photo-1486006920555-c77dce18193b?auto=format&fit=crop&w=1600&q=80);
background-size:cover;
background-position:center;
color:#fff;
padding:120px 0;
text-align:center;
+} */
+ .hero {
+ background-image: linear-gradient(rgba(135, 125, 145, 0.65), rgba(0, 0, 0, 0.65)),
+ url('https://images.unsplash.com/photo-1486006920555-c77dce18193b?auto=format&fit=crop&w=1600&q=80');
+ background-size: cover;
+ background-position: center;
+ background-repeat: no-repeat;
+ color: #fff;
+ padding: 120px 0;
+ text-align: center;
}
.hero h1{
@@ -50,11 +60,12 @@
}
.badge-course{
- background:var(--primary);
+ background:#887582;
color:#fff;
padding:8px 15px;
border-radius:30px;
font-size:13px;
+ font-weight:30px;
}
.read-btn{
@@ -62,6 +73,7 @@
color:#fff;
border-radius:30px;
padding:10px 25px;
+ font-weight: 40px;
}
.read-btn:hover{
@@ -186,8 +198,8 @@ $courses=[
-
-View Details
+
+Apply Course
diff --git a/resources/views/layouts/app.blade.php b/resources/views/layouts/app.blade.php
index 74ab313..f51a4a5 100644
--- a/resources/views/layouts/app.blade.php
+++ b/resources/views/layouts/app.blade.php
@@ -3,181 +3,243 @@
- @yield('title','Automobile Academic')
+
+ @yield('title', 'Automobile Academic')
-
-
-
+
+
+ .site-footer hr {
+ border-color: rgba(255,255,255,.15);
+ margin: 40px 0 20px;
+ }
+ .footer-bottom {
+ color: #b8a6b3;
+ font-size: 14px;
+ }
+
+ .animate {
+ animation-duration: 0.2s;
+ animation-fill-mode: both;
+ }
+
+ @keyframes slideIn {
+ 0% {
+ transform: translateY(1rem);
+ opacity: 0;
+ }
+ 100% {
+ transform: translateY(0rem);
+ opacity: 1;
+ }
+ }
+
+ .slideIn {
+ animation-name: slideIn;
+ }
+
-
-@yield('content')
-
-
+
+ @yield('content')
+
+
-
+