Last active
May 15, 2026 01:25
-
-
Save codigoconjuan/9108fbc0e5a567660c897ea186afda18 to your computer and use it in GitHub Desktop.
Formulario para editar la Contraseña del Usuario
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { route } from "ziggy-js"; | |
| export default function UpdatePassword() { | |
| return ( | |
| <> | |
| <div className="sm:flex sm:items-center mt-10"> | |
| <div className="sm:flex-auto"> | |
| <h1 className="font-bold text-4xl">Cambiar Contraseña</h1> | |
| <p className="mt-2 text-xl text-gray-500">Si deseas cambiar tu contraseña, utiliza este formulario </p> | |
| </div> | |
| <div className="mt-4 sm:mt-0 sm:ml-16 sm:flex-none"> | |
| <a href={route('dashboard')} | |
| className="block bg-amber-500 text-white w-full px-5 py-3 rounded-lg font-bold text-xl cursor-pointer text-center">Volver a Presupuestos</a> | |
| </div> | |
| </div> | |
| <form | |
| className="mt-14 space-y-3 max-w-2xl mx-auto" | |
| > | |
| <div className="flex flex-col gap-2"> | |
| <label className="font-bold text-2xl" htmlFor="password">Contraseña Actual</label> | |
| <input | |
| id="name" | |
| type="password" | |
| placeholder="Tu Contraseña Actual" | |
| className="w-full border border-gray-300 p-3 rounded-lg" | |
| /> | |
| </div> | |
| <div className="flex flex-col gap-2"> | |
| <label className="font-bold text-2xl" htmlFor="current_password">Nueva Contraseña</label> | |
| <input | |
| id="current_password" | |
| type="password" | |
| placeholder="Nueva Contraseña. Min. 8 caracteres" | |
| className="w-full border border-gray-300 p-3 rounded-lg" | |
| /> | |
| </div> | |
| <div className="flex flex-col gap-2 mt-4"> | |
| <label className="font-bold text-2xl" htmlFor="password_confirmation"> | |
| Confirmar Contraseña | |
| </label> | |
| <input | |
| id="password_confirmation" | |
| type="password" | |
| placeholder="Repite la nueva contraseña" | |
| className="w-full border border-gray-300 p-3 rounded-lg" | |
| /> | |
| </div> | |
| <input type="submit" value='Cambiar Contraseña' | |
| className="bg-purple-950 hover:bg-purple-800 w-full p-3 rounded-lg text-white font-bold text-xl cursor-pointer" /> | |
| </form> | |
| </> | |
| ) | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class UpdatePasswordRequest extends FormRequest | |
| { | |
| public function messages(): array | |
| { | |
| return [ | |
| 'current_password.required' => 'Debes ingresar tu contraseña actual.', | |
| 'current_password.current_password' => 'La contraseña actual es incorrecta.', | |
| 'password.required' => 'La Nueva Contraseña no puede ir vacia', | |
| 'password.min' => 'La Contraseña debe tener al menos :min caracteres.', | |
| 'password.confirmed' => 'Las Nuevas Contraseñas no coinciden.', | |
| ]; | |
| } | |
| public function rules(): array | |
| { | |
| return [ | |
| 'current_password' => ['required', 'current_password'], | |
| 'password' => ['required', 'confirmed', 'min:8'], | |
| ]; | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment