In this episode, we're focusing on letting users update their profile information—specifically their name and email address. We'll start by building out a simple form for these details, copying over some code we already have (like the login form) to speed things up. We'll also add a nice header and tidy up the styles for a better user experience.
After we've got our form set up, we'll wire it up so it shows the user’s current info by pulling it from the authentication data. This way, the user sees their existing details and can update them as needed. The form submission hooks right into Laravel Fortify to handle the update behind the scenes. We make sure to use the right HTTP method (PUT
not POST
!) and tweak a few options to keep the page from jumping around (so things feel smooth).
We then run into a common gotcha: error messages for form validation don't appear as expected, because they're nested under a named error bag. I'll show you how to grab those errors—or, if you'd rather, you can change how they're generated for a simpler case like ours.
Finally, to polish things up, we trigger a toast notification when the update is successful, letting users know their profile has been saved. This means jumping into Fortify’s response system to make sure it returns the right message, and tweaking our toast utility so messages appear reliably. Everything is kept nice and reusable, just in case you want separate error handling or more profile fields down the road.
Bottom line: by the end of this video, you’ll have a working, friendly profile update form with immediate feedback for your users.