Last active
May 15, 2026 01:24
-
-
Save codigoconjuan/a6145544d2ab94ae8064003798cbc1e2 to your computer and use it in GitHub Desktop.
Formulario para Actualizar el Perfil 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 UpdateProfile() { | |
| return ( | |
| <> | |
| <div className="sm:flex sm:items-center mt-10"> | |
| <div className="sm:flex-auto"> | |
| <h1 className="font-bold text-4xl">Ajustes</h1> | |
| <p className="mt-2 text-xl text-gray-500">Modifica tu información en esta página</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="name">Nombre</label> | |
| <input | |
| id="name" | |
| type="text" | |
| placeholder="Tu Nombre" | |
| 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="email">Email</label> | |
| <input | |
| id="email" | |
| type="email" | |
| placeholder="Tu Email" | |
| className="w-full border border-gray-300 p-3 rounded-lg" | |
| /> | |
| </div> | |
| <input type="submit" value='Guardar Cambios' | |
| 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 UpdateProfileRequest extends FormRequest | |
| { | |
| public function messages(): array | |
| { | |
| return [ | |
| 'name.required' => 'El nombre es obligatorio.', | |
| 'name.max' => 'El nombre no debe exceder :max caracteres.', | |
| 'email.required' => 'El email es obligatorio.', | |
| 'email.email' => 'Ingresa un email válido.', | |
| 'email.unique' => 'Este email ya está en uso.', | |
| 'email.max' => 'El email no debe exceder :max caracteres.', | |
| ]; | |
| } | |
| public function rules(): array | |
| { | |
| return [ | |
| 'name' => ['required', 'string', 'max:100'], | |
| 'email' => ['required', 'email', 'max:100', Rule::unique('users', 'email')->ignore($this->user()->id)], | |
| ]; | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment