In this episode, we walk through how to let users update their profile details in our app. We start by creating a new 'Account' page, adding it to our navigation, and setting up the form that will show the user's current name and email. To get this info, we fetch the authenticated user's details and pre-populate the form.
We adjust our form so users can change their name or email (but not password here—that's set up separately and you can handle it in a similar way if you want). Next, we set up a handy updateProfile
function that talks to Laravel Fortify's backend route for updating user info, making sure to send everything in the correct format.
Don't forget, after updating, we re-fetch the user's identity so all the latest info shows up right away—like in the navigation bar! We also cover a quick fix for any CORS issues you might run into.
By the end of the lesson, users will be able to view and update their profile details smoothly, with all the changes syncing up throughout the app.