middleware("createPassword"); } public function showCreatePassword($id, $token) { return view("auth.create_password")->with([ "id" => $id, "token" => $token ]); } public function createPassword(CreatePasswordRequest $request, $id, $token) { $user = User::find($id); $user->password = bcrypt($request->password); $user->is_active = true; $user->is_confirmed = true; if ($user->is_forgot_password) { $user->is_forgot_password = false; } $user->save(); session()->flash("password_created", "You have created a password successfully!"); return redirect()->route("auth.loginShow"); } }