You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jul 16, 2023. It is now read-only.
class User {
public static $rules = [
'email' => 'sometimes|required|unique:users,email|email',
'firstname' => 'sometimes|required|min:1',
'lastname' => 'sometimes|required|min:1',
];
}
The user is already saved in database, but without e-mail, firstname, or lastname.
The user wish to update ONLY his e-mail. When he sends the request, only containing an e-mail field, the validation will fail, because he did not provide an firstname and lastname.
How can I avoid that? I.e. only validate the fields that are sent in the request; so if firstname is not sent, Ardent will not validate it, and instead only validate the fields that are present.
The text was updated successfully, but these errors were encountered:
Say I have a user model like this:
The user is already saved in database, but without e-mail, firstname, or lastname.
The user wish to update ONLY his e-mail. When he sends the request, only containing an e-mail field, the validation will fail, because he did not provide an firstname and lastname.
How can I avoid that? I.e. only validate the fields that are sent in the request; so if firstname is not sent, Ardent will not validate it, and instead only validate the fields that are present.
The text was updated successfully, but these errors were encountered: