> For the complete documentation index, see [llms.txt](https://skaleptyltd.gitbook.io/build-solution/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://skaleptyltd.gitbook.io/build-solution/product-guides/system/users/edit-user.md).

# Edit user

When a user clicks on the "Edit" button next to a listed user, they will be taken to a page specifically designed for editing user details and roles. On this page, the user can make changes to the selected user's information and roles.\
\
Additionally, the user has the ability to set permissions for the particular user. They can choose whether the user can view the "Order\_home" or "Spec\_home" job types from the Jobs.

Furthermore, from this page, the user can force a password reset for the selected user if needed. This allows the user to reset their password and regain access to their account if they have forgotten their current password or are experiencing any login issues.

{% tabs %}
{% tab title="Form" %}

<figure><img src="https://1721684721-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FPaF9cGX0SlYrvgRNs9Wi%2Fuploads%2F3aIvQskC1RhC5XSsJHmh%2Fimage.png?alt=media&amp;token=37d896f5-793a-41c9-bf98-4f5d622c0d89" alt=""><figcaption><p>Edit User form</p></figcaption></figure>

The "Edit User" form contains the same fields and validations as the "Create User" form, and all these fields can be modified. If the user clicks on the "Cancel" button, any changes they made in the form will not be saved, and they will be redirected back to the list of users without any updates being applied.

On the other hand, if the user clicks on the "Submit" button, the updated information will be saved, and a success banner will appear to confirm the successful update. Despite this confirmation, the user will remain on the same "Edit User" page, where they can continue editing or make further changes if needed.

<figure><img src="https://1721684721-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FPaF9cGX0SlYrvgRNs9Wi%2Fuploads%2FnFBy95PEkB4OlWm8t7W2%2Fimage.png?alt=media&amp;token=03c14a92-cea2-4d9c-95f4-b256d7882932" alt=""><figcaption><p>Update user success banner</p></figcaption></figure>
{% endtab %}

{% tab title="Permissions" %}

<figure><img src="https://1721684721-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FPaF9cGX0SlYrvgRNs9Wi%2Fuploads%2FHYVrxrujkKMPIBJK99Ja%2Fimage.png?alt=media&amp;token=0be6b519-7dfc-4962-8681-293853f88b1a" alt=""><figcaption><p>Permissions</p></figcaption></figure>

Users can choose whether the user can view the "Order\_home" or "Spec\_home" job types from the Jobs.

{% hint style="info" %}
SPEC home - where we build the house and sell it later to anyone interested. The land is ours too.

ORDER home - where we build a house for someone of their choice and they bring their own land
{% endhint %}

{% endtab %}

{% tab title="Reset password" %}

<figure><img src="https://1721684721-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FPaF9cGX0SlYrvgRNs9Wi%2Fuploads%2FsWOI7maohoSDTz4Uo6jG%2Fimage.png?alt=media&amp;token=028aabf9-6780-4e81-9397-62e9fd22448d" alt=""><figcaption><p>Force reset password button</p></figcaption></figure>

Tuser uses this button in their own account, they will be taken to the "Change Password" screen. However, if the same button is clicked for another user, that user will be prompted to reset their password the next time they log in.

<figure><img src="https://1721684721-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FPaF9cGX0SlYrvgRNs9Wi%2Fuploads%2FYBhrG2oDQQwmjAh8RSHA%2Fimage.png?alt=media&amp;token=f7f345b4-28d2-4ca8-976b-90419141d4ac" alt=""><figcaption><p>Change password form</p></figcaption></figure>

After reaching the "Change password" page, the user cannot switch to any other screen until they finish the password reset process, even if they click the "Cancel" button. The user must complete the password update before navigating to other parts of the system.

<figure><img src="https://1721684721-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FPaF9cGX0SlYrvgRNs9Wi%2Fuploads%2F1LAUROBprODOtlwMvvKr%2Fimage.png?alt=media&amp;token=1c52b7c3-63cc-439e-99b3-5d30043c6b4c" alt=""><figcaption><p>Password validation banner</p></figcaption></figure>

The "Change password" page has certain checks in place to ensure the password update process goes smoothly. It checks if the old password and the new password are identical, and if they are, a validation banner is shown to the user, indicating that the change cannot be completed.

Additionally, all the fields on the page are mandatory, meaning the user must fill in all the required information before proceeding with the password change.

<figure><img src="https://1721684721-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FPaF9cGX0SlYrvgRNs9Wi%2Fuploads%2Fg9jNLSgF3TsxvrW2IesU%2Fimage.png?alt=media&amp;token=6ec06a50-4a5d-4507-83db-23fc04908af4" alt=""><figcaption><p>Mandatory field validation</p></figcaption></figure>

Furthermore, the system also verifies if the new password and the Confirm password entered by the user are the same. If they don't match, a validation banner is displayed to the user, and the password update process is not allowed to proceed until the matching condition is met.

<figure><img src="https://1721684721-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FPaF9cGX0SlYrvgRNs9Wi%2Fuploads%2FaqwrkyBJCUrO8ScicbZB%2Fimage.png?alt=media&amp;token=88cfe416-4f55-44a7-acaa-12045b533636" alt=""><figcaption><p>Confirm password field validation</p></figcaption></figure>
{% endtab %}

{% tab title="Lead source" %}

<figure><img src="https://1721684721-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FPaF9cGX0SlYrvgRNs9Wi%2Fuploads%2Fc10RsDZiNX7VDS2gyCgw%2Fimage.png?alt=media&amp;token=f884c4d3-4650-410f-b423-0d7ed8857c80" alt=""><figcaption><p>Lead source</p></figcaption></figure>

The "Lead source" section is only visible to users with the "salesperson" role type. In this section, there is a selection box where the user can choose multiple lead sources. These source options are added using Master data.

Only super admins have the ability to view these lead sources in users with the salesperson role.

The user can add or remove one or more lead sources from the selection box and then click on the "Update" button. After clicking the "Update" button, the data selected will be saved in a database table, and a success banner will appear to indicate that the update was successful.

<figure><img src="https://1721684721-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FPaF9cGX0SlYrvgRNs9Wi%2Fuploads%2FjeQ2u9RkS0fPLzVqwBq0%2Fimage.png?alt=media&amp;token=12277091-c9d9-4af0-8fc1-a88d52b2518d" alt=""><figcaption><p>Lead source update success banner</p></figcaption></figure>
{% endtab %}

{% tab title="Database tables and queries " %}

Here are the database tables related to Create user:

* users
* roles
* permissions
* lead\_source\_types

***

#### Function Path&#x20;

```
app/Http/Controllers/Admin/UserController.php->edit()

app/Http/Controllers/Admin/UserController.php->update()
```

{% endtab %}
{% endtabs %}
