Update a profile from a Vue settings page

Update the signed-in user from the kit's profile page. Ignore their id on the unique email rule.

For your AI agent

Copies a prompt. Paste it into the AI agent you already have open.

Read https://laravel-vuejs.space/laravel-profile-settings-vue.md
Update the signed-in user from the kit's profile page. Ignore their id on the unique email rule.
Do not accept id, isadmin, or emailverifiedat from the request.
Do not add a users admin screen on this change.
Show the diff. Do not commit.
On this page · 2 sections
  1. The fix
  2. FAQ

People searching “Laravel Vue profile settings” scaffold a second profile. The Vue starter kit already has resources/js/pages/settings/Profile.vue and a controller that updates the signed-in user. The Fortify guide is the auth around it. This page is the save.

TL;DR

  • Update the signed-in user from the kit’s profile page.
  • Ignore their id on the unique email rule.
  • Do not accept id, is_admin, or email_verified_at from the request.
  • Do not add a users admin screen on this change.

Who it's for: Laravel + Vue developers on Inertia

Applies to: Laravel 13 · Inertia 3 · Vue 3

The fix#

php
$validated = $request->validate([
    'name' => ['required', 'string', 'max:255'],
    'email' => [
        'required',
        'email',
        'max:255',
        Rule::unique('users', 'email')->ignore($request->user()->id),
    ],
]);

$user = $request->user();
$user->fill($validated);

if ($user->isDirty('email')) {
    $user->email_verified_at = null;
}

$user->save();

Clearing email_verified_at forces the verification mail again. Skip that line and a user can switch the address to one they do not own and stay “verified”.

The form posts the name and the email and reads form.errors.email. Do not accept id, is_admin, or email_verified_at from the request. Do not add a users admin screen on this change. One person edits their own row.

FAQ#

How do I update a profile from a Vue settings page?

Update the signed-in user from the kit's profile page. Ignore their id on the unique email rule.

What goes wrong with Laravel Vue profile settings?

Many developers scaffold a second profile. Do not accept id, is_admin, or email_verified_at from the request.

Found this useful?

Ask questions, share what you built.

Join thousands of Laravel and Vue developers in our Facebook group, or get new posts in your Telegram feed. Sharing this article helps too.

Keep reading

Newsletter

Get the best of Laravel & Vue, once a month.

One short email with new guides, release notes worth reading and hand-picked community links. No spam, unsubscribe any time.