diff --git a/app/Http/Controllers/StudentPortalController.php b/app/Http/Controllers/StudentPortalController.php index c179710..22180cd 100644 --- a/app/Http/Controllers/StudentPortalController.php +++ b/app/Http/Controllers/StudentPortalController.php @@ -34,28 +34,94 @@ public function studentlogin(Request $request) } -// public function showProfile(Request $request) -// { - -// $log_id = $request->session()->get('student_id'); - -// if (!$log_id) { -// return redirect('/')->with('error', 'Please login first!'); -// } +public function showProfile(Request $request) +{ + + $log_id = $request->session()->get('student_log_id'); + $student_code = $request->session()->get('student_id'); - -// $student = DB::table('student_details') -// ->where('student_portal_log_id', $log_id) -// ->first(); + if (!$log_id && !$student_code) { + return redirect('/')->with('error', 'Please login first!'); + } - -// if (!$student) { -// return redirect()->back()->with('error', 'Student details not found!'); -// } + + $student = DB::table('student_details') + ->where('student_portal_log_id', $log_id) + ->orWhere('student_id', $student_code) + ->first(); - -// return view('StudentProfile', compact('student')); + + if (!$student) { + return redirect()->back()->with('error', 'Student details not found in database!'); + } + + return view('StudentProfile', compact('student')); +} + + +// public function showProfile(Request $request) +// { + +// $log_id = $request->session()->get('student_log_id'); +// $student_code = $request->session()->get('student_id'); + +// if (!$log_id && !$student_code) { +// return redirect('/')->with('error', 'Please login first!'); // } + +// $student = DB::table('student_details') +// ->where('student_portal_log_id', $log_id) +// ->orWhere('student_id', $student_code) +// ->first(); + + +// if (!$student) { +// return redirect()->back()->with('error', 'Student details not found in database!'); +// } + +// return view('StudentProfile', compact('student')); +// } + + + +// public function showProfile(Request $request) +// { + +// $log_id = $request->session()->get('student_id'); + +// if (!$log_id) { +// return redirect('/')->with('error', 'Please login first!'); +// } + + +// $student = DB::table('student_details') +// ->where('student_id', $log_id) +// ->orWhere('student_portal_log_id', $log_id) +// ->first(); + + +// if (!$student) { +// $student = (object)[ +// 'image' => '', +// 'full_name' => 'Data Not Found (Check DB)', +// 'student_id' => $log_id, +// 'nic_passport' => 'N/A', +// 'date_of_birth' => '2000-01-01', +// 'gender' => 'N/A', +// 'email' => 'N/A', +// 'phone' => 'N/A', +// 'qualification' => 'N/A', +// 'institute' => 'N/A', +// 'year_completed' => 'N/A', +// 'course_name' => 'N/A', +// 'duration' => 'N/A', +// 'current_semester' => 'N/A', +// 'trainer_name' => 'N/A' +// ]; +// } + +// return view('StudentProfile', compact('student')); +// } } diff --git a/app/Http/Controllers/auth/ForgotPasswordController.php b/app/Http/Controllers/auth/ForgotPasswordController.php new file mode 100644 index 0000000..747b02f --- /dev/null +++ b/app/Http/Controllers/auth/ForgotPasswordController.php @@ -0,0 +1,41 @@ +validate([ + 'email' => ['required', 'email'], + ]); + + // 2. Attempt to send the password reset link via Laravel Broker + $status = Password::sendResetLink( + $request->only('email') + ); + + // 3. Redirect back with status message or validation error + return $status === Password::RESET_LINK_SENT + ? back()->with('status', __($status)) + : back()->withErrors(['email' => __($status)]); + } +} \ No newline at end of file diff --git a/app/Http/Controllers/studentportalnavController.php b/app/Http/Controllers/studentportalnavController.php index cc7b46b..2b855fd 100644 --- a/app/Http/Controllers/studentportalnavController.php +++ b/app/Http/Controllers/studentportalnavController.php @@ -3,17 +3,25 @@ namespace App\Http\Controllers; use Illuminate\Http\Request; +use Illuminate\Support\Facades\Auth; class studentportalnavController extends Controller { public function logout(Request $request) { + + $request->session()->forget(['student_log_id', 'student_id']); + + Auth::logout(); + + $request->session()->invalidate(); $request->session()->regenerateToken(); + return response()->json([ 'success' => true, 'message' => 'Logged out successfully' ]); } -} +} \ No newline at end of file diff --git a/resources/views/StudentProfile.blade.php b/resources/views/StudentProfile.blade.php index dc056c4..64a8d85 100644 --- a/resources/views/StudentProfile.blade.php +++ b/resources/views/StudentProfile.blade.php @@ -177,96 +177,92 @@ body {
-

- - Student Profile -

-

- Manage your personal information and academic details. -

+

Student Profile

+

Manage your personal information and academic details.

+
- - +
- -

Kasun Perera

+ Profile Image + +

{{ $student->full_name }}

- - Student ID : AEA20260045 + + Student ID : {{ $student->student_id }} -
+
-
- +

- - Personal Information + Personal Information

Full Name - Kasuni Perera + {{ $student->full_name }}
NIC / Passport - 200012345678 + {{ $student->nic_passport }}
Date of Birth - 15 March 2000 + + {{ !empty($student->date_of_birth) ? date('d F Y', strtotime($student->date_of_birth)) : 'N/A' }} +
Gender - Male + {{ $student->gender }}
Email - student@email.com + {{ $student->email }}
Phone - +94 77 1234567 + {{ $student->phone }}
-
+
-

- - Educational Background + Educational Background

Qualification - NVQ Level 4 + {{ $student->qualification }}
Institute - ABC Technical College + {{ $student->institute }}
Year Completed - 2025 + {{ $student->year_completed }}
@@ -274,24 +270,23 @@ body {
-

Course Details

+

Course Details

- Diploma in Automobile Engineering + {{ $student->course_name }} +
+
+ Duration : {{ $student->duration }}
- Duration : 2 Years + Current Semester : {{ $student->current_semester }}
- Current Semester : Semester 2 -
-
- Trainer : Mr. Nimal Silva + Trainer : {{ $student->trainer_name }}
-
- + @endsection \ No newline at end of file diff --git a/resources/views/forgotPassword.blade.php b/resources/views/forgotPassword.blade.php new file mode 100644 index 0000000..ee30fe0 --- /dev/null +++ b/resources/views/forgotPassword.blade.php @@ -0,0 +1,327 @@ + + + + + + {{ session('step') == 'otp' ? 'Verify OTP' : 'Forgot Password' }} + + + +
+ + {{-- SUCCESS & ERROR ALERTS --}} + @if (session('status')) +
{{ session('status') }}
+ @endif + + @if ($errors->has('otp')) +
{{ $errors->first('otp') }}
+ @endif + + {{-- SECTION 2: VERIFY OTP (Shows when session step is 'otp') --}} + @if (session('step') === 'otp') +
+ + + +
+ +

Enter OTP Code

+

We've sent a 6-digit verification code to
{{ session('email', old('email')) }}

+ +
+ @csrf + + + +
+ + + + + + +
+ + +
+ +
+ Didn't receive the code? +
+ @csrf + + +
+
+ + {{-- SECTION 1: FORGOT PASSWORD (Default view) --}} + @else +
+ + + +
+ +

Forgot Password?

+

No worries! Enter your email and we'll send you a link to reset your password.

+ +
+ @csrf +
+ + + @error('email') +
{{ $message }}
+ @enderror +
+ + +
+ @endif + + ← Back to Login +
+ + @if (session('step') === 'otp') + + @endif + + \ No newline at end of file diff --git a/resources/views/layouts/studentportalnav.blade.php b/resources/views/layouts/studentportalnav.blade.php index e3ac99c..134ee01 100644 --- a/resources/views/layouts/studentportalnav.blade.php +++ b/resources/views/layouts/studentportalnav.blade.php @@ -296,8 +296,11 @@ Feedback & Complain - - Student Profile + + + Student Profile @@ -344,7 +347,37 @@ + + + \ No newline at end of file diff --git a/resources/views/signup.blade.php b/resources/views/signup.blade.php index fde396c..2eacdb6 100644 --- a/resources/views/signup.blade.php +++ b/resources/views/signup.blade.php @@ -110,14 +110,14 @@ width: 100%; font-size: 16px; font-weight: 600; - background: #5E244E; + background: #822424; border: none; color: white; transition: background 0.2s ease-in-out, transform 0.1s ease; } .btn-primary:hover, .btn-primary:focus { - background: #4a1c3e; + background: #822424; color: white; } diff --git a/resources/views/welcome.blade.php b/resources/views/welcome.blade.php index 126bc20..55314c4 100644 --- a/resources/views/welcome.blade.php +++ b/resources/views/welcome.blade.php @@ -31,13 +31,14 @@ /* ===== Global Improvements ===== */ body { font-family: 'Segoe UI', Arial, sans-serif; - color: #FFFD67; + color: #1E293B; background-color: #ffffff; } .section { padding: 53px 0; } + .section-title, h2, h3, h4, h5, h6 { font-family: 'Segoe UI', Arial, sans-serif; @@ -92,14 +93,12 @@ body { } .btn-outline-light-custom:hover { - background: #fff; + background: #f2e862; color: var(--primary); border-color: #fff; transform: translateY(-3px); } - - .hero { height:636px; background: linear-gradient(rgba(207, 226, 255, 0.88), rgba(0, 9, 15, 0.75)), url('https://images.unsplash.com/photo-1517524206127-48bbd363f3d7?auto=format&fit=crop&w=1600&q=80'); @@ -130,14 +129,12 @@ body { color: white; } - .courses-section { background-color: var(--bg-light); } .course-card { border: 1px solid var(--card-border); - /* border-radius: 12px !important; */ overflow: hidden; background: #fff; transition: all 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94); @@ -240,7 +237,7 @@ body { } .course-footer { - margin-top: auto; /* Pushes the footer area to the exact bottom of the card */ + margin-top: auto; padding-top: 15px; border-top: 1px solid rgba(15, 44, 89, 0.08); } @@ -265,9 +262,7 @@ body { .read-btn { background:#822424; - /* background: #3E51B8; */ color: white; - /* border: 2px solid var(--primary); */ padding: 10px 20px; font-weight: 700; border-radius: 6px; @@ -302,14 +297,6 @@ body { z-index: 2; } -.section-divider { - height: 4px; - width: 60px; - background-color: var(--secondary); - margin: 15px auto 0 auto; - border-radius: 2px; -} - .custom-feature-card { background: rgba(255, 255, 255, 0.43); backdrop-filter: blur(10px); @@ -320,16 +307,15 @@ body { transition: all 0.3s ease; } -.custom-feature-card:hover - { +.custom-feature-card:hover { transform: translateY(-5px); background: rgba(255, 255, 255, 0.07); border-color: rgba(255, 255, 255, 0.2); } .icon-box { - background: #6a2525; - color: #FFE618; + background: #6a2525; + color: #FFE618; width: 60px; height: 60px; border-radius: 12px; @@ -357,6 +343,14 @@ body { opacity: 1; transform: translateY(0) scale(1); } + +/* ===== Modal Styling ===== */ +.custom-modal-header { + background-color: white; + color: #fff; + border-bottom: 3px solid var(--secondary); + padding: 23px; +} {{-- ===================== HERO ===================== --}} @@ -366,14 +360,14 @@ body {

Automobile Engineering Academy

Driving Innovation Through Education, Research & Technology

-
+
- Apply Now + Apply Now Explore Courses - + Contact Admissions
@@ -381,19 +375,21 @@ body {
-{{-- ===================== IMPROVED COURSES SECTION ===================== --}} +{{-- ===================== COURSES SECTION ===================== --}}
-
Academic Programs -

Our Top Courses

+

Our Top Courses

Explore our professional, industry-recognized automotive engineering curriculums.

@php $courses = [ [ + 'id' => 'course-1', + 'category' => 'mechanical', + 'level' => 'ol', 'image' => 'https://images.unsplash.com/photo-1486262715619-67b85e0b08d3?auto=format&fit=crop&w=800&q=80', 'title' => 'Automotive Engineering Course', 'desc' => 'Learn vehicle design, engine technology, diagnostics and manufacturing workflows comprehensively.', @@ -403,6 +399,9 @@ body { 'badge' => 'Popular' ], [ + 'id' => 'course-2', + 'category' => 'mechanical', + 'level' => 'al', 'image' => 'https://images.unsplash.com/photo-1503376780353-7e6692767b70?auto=format&fit=crop&w=800&q=80', 'title' => 'Mechanical Systems Course', 'desc' => 'Study power transmission systems, active suspension, breaking dynamics and diagnostics.', @@ -412,6 +411,9 @@ body { 'badge' => 'Bestseller' ], [ + 'id' => 'course-3', + 'category' => 'ev', + 'level' => 'al', 'image' => 'https://images.unsplash.com/photo-1502877338535-766e1452684a?auto=format&fit=crop&w=800&q=80', 'title' => 'Electric Vehicle Tech Course', 'desc' => 'Master advanced EV battery management, powertrains, smart networks and electric mobility.', @@ -427,38 +429,36 @@ body { @foreach($courses as $key => $course)
- +
{{ $course['badge'] }} {{ $course['title'] }}
-
-

{{ $course['title'] }}

-
- {{ $course['author'] }} -
-

{{ $course['desc'] }}

- -
- Practical Labs - Accredited -
- - -
+
+

{{ $course['title'] }}

+
+ {{ $course['author'] }} +
+

{{ $course['desc'] }}

+ +
+ Practical Labs + Accredited
- + +
+
@endforeach @@ -469,11 +469,9 @@ body { View All Courses
-
- {{-- ===================== WHY CHOOSE US ===================== --}}
@@ -491,7 +489,7 @@ body {
- +

Modern Laboratories

State-of-the-art facilities equipped with latest industrial testing tools.

@@ -530,8 +528,65 @@ body {
+{{-- ===================== COURSE FINDER MODAL ===================== --}} + + diff --git a/routes/web.php b/routes/web.php index 136921c..2e0349a 100644 --- a/routes/web.php +++ b/routes/web.php @@ -6,6 +6,9 @@ use App\Http\Controllers\StudentPortalController; use App\Http\Controllers\ContactMsgController; use App\Http\Controllers\FeedbackController; use App\Http\Controllers\studentportalnavController; +use App\Http\Controllers\auth\asswordController; +use App\Http\Controllers\Auth\ForgotPasswordController; + /* |-------------------------------------------------------------------------- @@ -17,8 +20,44 @@ use App\Http\Controllers\studentportalnavController; Route::get('/', function () { return view('welcome'); }); + -Route::post('/studentlogout', [studentportalnavController::class, 'logout']); + +Route::get('forgot-password', [ForgotPasswordController::class, 'showLinkRequestForm'])->name('password.request'); +Route::post('forgot-password', [ForgotPasswordController::class, 'sendResetLinkEmail'])->name('password.email'); + + +// Route::get('password/reset', [ForgotPasswordController::class, 'showLinkRequestForm']) +// ->name('password.request'); + +// Route::post('password/email', [ForgotPasswordController::class, 'sendResetLinkEmail']) +// ->name('password.email'); + +// Route::get('password/reset/{token}', [ForgotPasswordController::class, 'showResetForm']) +// ->name('password.reset'); + +// Route::post('password/reset', [ForgotPasswordController::class, 'reset']) +// ->name('password.update'); + + + +// Password Reset Routes +Route::get('password/reset', [ForgotPasswordController::class, 'showLinkRequestForm']) + ->name('password.request'); + +Route::post('password/email', [ForgotPasswordController::class, 'sendResetLinkEmail']) + ->name('password.email'); + +Route::get('password/reset/{token}', [ForgotPasswordController::class, 'showResetForm']) + ->name('password.reset'); + +Route::post('password/reset', [ForgotPasswordController::class, 'reset']) + ->name('password.update'); +Route::post('/studentlogout', [studentportalnavController::class, 'logout'])->name('student.logout'); + +Route::get('/StudentProfile', [StudentPortalController::class, 'showProfile'])->name('StudentProfile'); + +// Route::post('/studentlogout', [studentportalnavController::class, 'logout']); Route::post('/feedback/store', [FeedbackController::class, 'feedback']) ->middleware('auth') ->name('feedback.store'); @@ -75,4 +114,4 @@ Route::view('/Assignments','Assignments')->name('Assignments'); Route::view('/Studentguidelines','Studentguidelines')->name('Studentguidelines'); Route::view('/results','results')->name('results'); Route::view('/Feedback&Complain','Feedback&Complain')->name('Feedback&Complain'); -Route::view('/StudentProfile','StudentProfile')->name('StudentProfile'); +// Route::view('/StudentProfile','StudentProfile')->name('StudentProfile');