Profile
A /profile page for every signed-in user: update name, email and avatar, change the password, manage two-factor authentication, delete the account. It renders in the user shell, not the admin shell.


What it adds
| File | Purpose |
|---|---|
app/Livewire/Profile/ProfilePage.php and the views under resources/views/livewire/profile/ | The page and its four cards |
app/Livewire/Actions/Logout.php | Used by the delete-account flow |
database/migrations/*_add_avatar_path_to_users_table.php | |
resources/views/components/action-message.blade.php | The "Saved." note on the cards |
TwoFactorAuthenticatable in app/Models/Concerns/UiKitUser.php | Added to the generated trait |
Install
php artisan ui-kit:install-module profile
No required Composer packages. composer require intervention/image turns on automatic 200 by 200 avatar resizing; without it the upload is stored as sent.
What the installer changes
- Adds the
/profileroute between the markers inroutes/ui-kit-user.php. - Runs the avatar migration and
php artisan storage:link, which the avatar upload needs. - Regenerates the
UiKitUsertrait withTwoFactorAuthenticatableand re-applies it.
Routes
| Route | Name |
|---|---|
GET /profile | profile |
Two-factor authentication
The card drives Fortify's actions end to end:
- Enable generates a secret and shows the QR code.
- Confirm, when Fortify's
confirmoption is on, asks for a code from the authenticator before the secret counts. - Recovery codes are shown and can be regenerated.
- Disable removes the secret.
The installed config/fortify.php turns on Fortify's confirmPassword option. Since 0.4.1 the card honours it: enabling, disabling, showing and regenerating recovery codes first send the user to /confirm-password unless the password was confirmed within auth.password_timeout (three hours by default), and the confirm page returns them to /profile.
From the next sign-in the core login flow stages the challenge described under Core.
The page
Four cards, each a design-system panel:
- Profile information. The photo is a round avatar showing the user's initials until a photo exists. Beside it, a drop zone labelled "Profile photo" takes a JPEG, PNG or WEBP up to 2 MB, dropped or chosen. Once a file is picked, Save photo and Cancel appear under it; Remove shows while a photo is set. Name and email follow, with a resend link for an unverified address, limited to six a minute per user (shared with the verify-email page).
- Update password: current, new and confirm.
- Two-factor authentication, described below.
- Delete account. The button opens a
ds::modalthat asks for the password; deleting the account deletes the photo too. A wrong password keeps the dialog open with the error under the field; Cancel, the backdrop or Escape close it.
Avatars
Uploads are stored on the public disk under a random 40-character name (before 0.4.1 the name was the user's id, so every photo was guessable) with a content-derived extension; replacing a photo deletes the old file. The path is saved in users.avatar_path with forceFill(), so a stock User model needs no change to $fillable. (Before 0.4 the module used update(), which a stock model ignores, and the photo never saved; Troubleshooting has the fix for an older install.) ui-kit:doctor fails storage linked (profile avatars) when public/storage is missing.
The generated UiKitUser trait gains avatarUrl(): ?string, the public-disk URL or null, and the kit shows the photo wherever a user appears: the admin rail's footer, the admin user list and detail, and the user shell's header, which links to /profile.
Removing
Delete the Livewire components, views and the action-message Blade component, remove the route line between the user-route markers, roll back the avatar migration, remove TwoFactorAuthenticatable from the trait, and remove profile from installed_modules.