I am trying to validate a password field only if it is present. I want to allow someone to edit a user and they may or may not want to change the users password. So I thought I
I think we should tell laravel If password is not empty put the rules otherwise do nothing.
$this->validate($request, [ 'password' => $request->password != null ?'sometimes|required|min:8': '' ]);