Vue Starter Kit - v1.0.1
User Settings
Three pages live under /settings, all gated by the auth middleware:
| Route | Controller | Page |
|---|---|---|
GET /settings |
(redirect) | → /settings/profile |
GET|PATCH|DELETE /settings/profile |
Settings\ProfileController |
settings/Profile |
GET|PUT /settings/password |
Settings\PasswordController |
settings/Password |
GET /settings/appearance |
Settings\AppearanceController |
settings/Appearance |
All three pages are wrapped in SettingsLayout, which composes AppLayout and adds the 3-tab settings sidebar.
Profile
Settings\ProfileController:
edit()— renderssettings/ProfilewithmustVerifyEmailflag and the optional sessionstatusupdate(ProfileUpdateRequest $request)— fills the user, nullsemail_verified_atif email changed, saves, flashessuccessdestroy(Request $request)— validates the user'scurrent_password, logs them out, deletes the user, redirects to/
ProfileUpdateRequest enforces a unique email (ignoring the current user's row).
The Inertia page also includes the delete account section — an inline confirm form behind a "Delete account" button.
Password
Settings\PasswordController:
edit()renderssettings/Passwordupdate(PasswordUpdateRequest $request)validatescurrent_password+password(viaPassword::defaults()), hashes, updates, flashessuccess
Appearance
Settings\AppearanceController@edit just renders the page — there's no server-side state. The Inertia page reads/writes the user's choice to localStorage under theme and applies data-theme to <html>. Three options: light, dark, system.
Customizing
Add a new settings tab:
-
Add a route in
routes/web.php(under theauthmiddleware group):Route::get('settings/notifications', [NotificationsController::class, 'edit']) ->name('settings.notifications'); -
Create the controller + Inertia page (
pages/settings/Notifications.vue) usingSettingsLayout. -
Add the tab to
resources/js/layouts/SettingsLayout.vue'sTABSarray.
Tests
tests/Feature/Settings/ProfileUpdateTest.php— page renders, update works, email verification status handling, account deletion + wrong-password rejectiontests/Feature/Settings/PasswordUpdateTest.php— successful change, wrong current passwordtests/Feature/Settings/AppearanceTest.php— page renders for auth users, redirects guests