0👍
✅
replacing ‘present’ with nullable fixed the issue.
public function rules(): array
{
return [
'name' => ['sometimes', 'nullable', 'string', 'max:255'],
'username' => ['sometimes','nullable', 'max:255', 'string', 'unique:users,username'],
'email' => ['sometimes', 'nullable', 'email', 'unique:users,email', 'max:255'],
'password' => ['sometimes', 'nullable','min:8', 'max:255', 'confirmed']
];
}
Source:stackexchange.com