REDROOM
PHP 8.3.30
Path:
Logout
Edit File
Size: 2.80 KB
Close
/home/getspomw/royalsquad.us/app/Http/Controllers/CustomPasswordResetController.php
Text
Base64
<?php namespace App\Http\Controllers; use App\Models\User; use Illuminate\Http\Request; use Illuminate\Support\Facades\DB; use Illuminate\Support\Facades\Hash; use Illuminate\Support\Facades\Mail; use Illuminate\Support\Str; class CustomPasswordResetController extends Controller { /** * Display the password reset request form. */ public function showLinkRequestForm() { return view('auth.passwords.email'); } /** * Handle sending a password reset link to the user. */ public function sendResetLink(Request $request) { $request->validate([ 'email' => 'required|email', ]); $email = $request->email; $token = Str::random(60); $existingToken = DB::table('password_reset_tokens')->where('email', $email)->first(); if ($existingToken) { // Update the existing token DB::table('password_reset_tokens') ->where('email', $email) ->update(['token' => $token, 'created_at' => now()]); } else { // Create a new token record DB::table('password_reset_tokens')->insert([ 'email' => $email, 'token' => $token, 'created_at' => now(), ]); } // Send reset email Mail::send('auth.passwords.reset_email', ['token' => $token, 'email' => $email], function ($message) use ($email) { $message->to($email); $message->subject('Password Reset Request'); }); return redirect()->route('login')->with('status', 'We have emailed your password reset link!'); } /** * Display the password reset form. */ public function showResetForm(Request $request, $token) { return view('auth.passwords.reset', ['token' => $token, 'email' => $request->email]); } /** * Handle resetting the user's password. */ public function reset(Request $request) { $request->validate([ 'email' => 'required|email|exists:users,email', 'password' => 'required|confirmed|min:6', ]); // Verify token and email match $resetRecord = DB::table('password_reset_tokens')->where('token', $request->token)->first(); if (!$resetRecord || $resetRecord->email !== $request->email) { return back()->withErrors(['email' => 'Invalid token or email.']); } // Update the user's password $user = User::where('email', $request->email)->first(); $user->password = Hash::make($request->password); $user->save(); // Remove the used token DB::table('password_reset_tokens')->where('token', $request->token)->delete(); return redirect('/login')->with('status', 'Your password has been reset!'); } }
Save
Close
Exit & Reset
Text mode: syntax highlighting auto-detects file type.
Directory Contents
Dirs: 0 × Files: 12
Delete Selected
Select All
Select None
Sort:
Name
Size
Modified
Enable drag-to-move
Name
Size
Perms
Modified
Actions
AccessControlController.php
2.85 KB
lrw-rw-rw-
2025-09-18 05:50:45
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
AdminController.php
315 B
lrw-rw-rw-
2025-09-17 06:52:53
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
BlogCategoryController.php
2.74 KB
lrw-rw-rw-
2025-09-17 06:52:53
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
BlogController.php
6.83 KB
lrw-rw-rw-
2025-09-17 06:52:53
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
ContactController.php
4.65 KB
lrw-rw-rw-
2026-02-09 06:01:39
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Controller.php
77 B
lrw-rw-rw-
2025-09-17 06:52:53
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
CustomPasswordResetController.php
2.80 KB
lrw-rw-rw-
2025-09-18 05:51:38
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
error_log
616 B
lrw-r--r--
2026-04-19 15:59:24
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
LoginController.php
3.58 KB
lrw-rw-rw-
2025-09-18 05:56:23
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
RegisterController.php
1.48 KB
lrw-rw-rw-
2025-09-17 06:52:53
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
SettingController.php
8.60 KB
lrw-rw-rw-
2025-09-18 05:56:47
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
ViewController.php
8.22 KB
lrw-rw-rw-
2026-02-09 07:03:26
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Zip Selected
If ZipArchive is unavailable, a
.tar
will be created (no compression).