I get an error when I update the user's email in Laravel.
SQLSTATE[HY000]: General error: 1364 Field 'password' doesn't have a default value
When I change the user's role or name without changing their email, it does not give an error.
The affected file:
/app/Http/Livewire/User/AddUserModal.php
We will fix it. The error you're encountering occurs because the update operation relies on the user's email as the reference, which leads to the creation of a new record when a new email is provided.
To fix this, need to use the user's id as the reference for the update operation rather than their email.
Thanks