-
Notifications
You must be signed in to change notification settings - Fork 93
Profile Edit Page
Tony Lea edited this page Aug 7, 2023
·
1 revision
This is the documentation for profile/edit.blade.php
This file is a Blade view responsible for allowing the user to edit their profile information, change password, and delete their account.
This file uses the following libraries:
-
Laravel's Support Facades
The file uses the Hash, Password, and Rule Facades from Laravel's Support library.
-
Livewire's Volt functions
The file uses the 'with', 'state', 'rules', and 'mount' functions from Livewire's Volt library.
-
Laravel's Facade Auth
use Illuminate\Support\Facades\Hash;
use Illuminate\Support\Facades\Password;
use Illuminate\Auth\Events\PasswordReset;
use Illuminate\Http\Request;
use function Laravel\Folio\{middleware};
use function Livewire\Volt\{with, state, rules, mount};
use Illuminate\Validation\Rule;
This file uses auth and verified middlewares:
middleware(['auth', 'verified']);
This file has six states:
- user - The authenticated user.
- name - The user's name.
- email - The user's email.
- current_password - The user's current password.
- new_password - The user's new password.
- new_password_confirmation - Confirmation of new password.
- delete_confirm_password - Confirmation to delete account.
state(['user' => auth()->user()])->locked();
state([
'name' => '',
'email' => '',
'current_password' => '',
'new_password' => '',
'new_password_confirmation' => '',
'delete_confirm_password' => '',
]);
This file includes three methods: $updateProfile
, $updatePassword
, and $destroy
.
- $updateProfile - This method updates user's profile information.
- $updatePassword - This method updates user's password.
- $destroy - This method deletes user's account.
The main rendering function uses layouts.dashboard file as the parent layout.
It contains three main sections:
- Update Profile Section: Allows users to update their name and email.
- Update Password Section: Allows users to update their password.
- Delete User Section: Allows users to delete their account.
<x-layouts.dashboard>
<x-slot name="header">
...
</x-slot>
@volt('profile.edit')
<div class="py-12">
...
</div>
@endvolt
</x-layouts.dashboard>