|string> */ public function rules(): array { return [ 'current_password' => ['required', 'string', 'current_password:sanctum'], 'password' => ['required', 'string', 'min:8', 'confirmed', 'different:current_password'], ]; } protected function prepareForValidation(): void { if ($this->has('currentPassword') && ! $this->has('current_password')) { $this->merge([ 'current_password' => $this->input('currentPassword'), ]); } if ($this->has('passwordConfirmation') && ! $this->has('password_confirmation')) { $this->merge([ 'password_confirmation' => $this->input('passwordConfirmation'), ]); } } }