diff --git a/Web-Application/Manually/app/Http/Controllers/Auth/PasswordController.php b/Web-Application/Manually/app/Http/Controllers/Auth/PasswordController.php
index fbc8b15..9e1ecbe 100644
--- a/Web-Application/Manually/app/Http/Controllers/Auth/PasswordController.php
+++ b/Web-Application/Manually/app/Http/Controllers/Auth/PasswordController.php
@@ -6,6 +6,8 @@ use App\Models\User;
use Illuminate\Support\Str;
use Illuminate\Http\Request;
use App\Http\Controllers\Controller;
+use App\Http\Requests\ChangePasswordRequest;
+use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\Hash;
use Illuminate\Support\Facades\Password;
use Illuminate\Auth\Events\PasswordReset;
@@ -54,4 +56,23 @@ class PasswordController extends Controller
? redirect()->route('login')->with('status', __($status))
: back()->withErrors(['email' => [__($status)]]);
}
+
+ public function changePasswordPage()
+ {
+ $user = Auth::user();
+ return view('auth.change-password', compact('user'));
+ }
+
+ public function changePassword(ChangePasswordRequest $request)
+ {
+ $inputs = $request->all();
+
+ $user = Auth::user();
+
+ $user->update([
+ 'password' => Hash::make($inputs['password']),
+ ]);
+
+ return redirect()->route('dashboard')->with('success', 'Password updated successfully.');
+ }
}
diff --git a/Web-Application/Manually/app/Http/Controllers/Auth/ProfileController.php b/Web-Application/Manually/app/Http/Controllers/Auth/ProfileController.php
new file mode 100644
index 0000000..27152cd
--- /dev/null
+++ b/Web-Application/Manually/app/Http/Controllers/Auth/ProfileController.php
@@ -0,0 +1,39 @@
+user = Auth::user();
+ }
+ public function showProfile()
+ {
+ $user = $this->user;
+ return view("auth.profile", compact("user"));
+ }
+
+ public function updateProfile(ProfileRequest $request)
+ {
+ $inputs = $request->only('name', 'email');
+ $data = ['name' => $inputs['name']];
+
+ if ($inputs['email'] !== $this->user->email) {
+ $data['email'] = $inputs['email'];
+ $data['email_verified_at'] = null;
+ $data['remember_token'] = null;
+ }
+
+ $this->user->update($data);
+
+ return redirect()->route("dashboard")->with("success", "Profile updated successfully.");
+ }
+}
diff --git a/Web-Application/Manually/app/Http/Requests/ChangePasswordRequest.php b/Web-Application/Manually/app/Http/Requests/ChangePasswordRequest.php
new file mode 100644
index 0000000..8a0bfb3
--- /dev/null
+++ b/Web-Application/Manually/app/Http/Requests/ChangePasswordRequest.php
@@ -0,0 +1,28 @@
+|string>
+ */
+ public function rules(): array
+ {
+ return [
+ 'password' => 'required|min:8|confirmed',
+ ];
+ }
+}
diff --git a/Web-Application/Manually/app/Http/Requests/ProfileRequest.php b/Web-Application/Manually/app/Http/Requests/ProfileRequest.php
new file mode 100644
index 0000000..5acfb6f
--- /dev/null
+++ b/Web-Application/Manually/app/Http/Requests/ProfileRequest.php
@@ -0,0 +1,29 @@
+|string>
+ */
+ public function rules(): array
+ {
+ return [
+ 'name' => 'required|string|max:255',
+ 'email' => 'required|email|unique:users,email,' . auth()->id(),
+ ];
+ }
+}
diff --git a/Web-Application/Manually/app/Models/User.php b/Web-Application/Manually/app/Models/User.php
index 3ccce93..535af62 100644
--- a/Web-Application/Manually/app/Models/User.php
+++ b/Web-Application/Manually/app/Models/User.php
@@ -25,7 +25,9 @@ class User extends Authenticatable implements MustVerifyEmail
'github_token',
'github_refresh_token',
'google2fa_secret',
- 'verify2fa'
+ 'verify2fa',
+ 'email_verified_at',
+ 'remember_token'
];
/**
diff --git a/Web-Application/Manually/resources/views/auth/change-password.blade.php b/Web-Application/Manually/resources/views/auth/change-password.blade.php
new file mode 100644
index 0000000..ebf31ea
--- /dev/null
+++ b/Web-Application/Manually/resources/views/auth/change-password.blade.php
@@ -0,0 +1,45 @@
+@extends('layouts.aside')
+
+@section('main')
+
+Change Password
+
+
+
+ Edit Profile
+
+
+
+