make the phone or mobile phone field mandatory / required in Frontend and Backoffice

Go to Customers -> Addresses, in bottom, Set required fields for this section to select the mobile phone (this will prohibit the blank mobile phone field in the frontend and "optional" willl be omitted)

In the backoffice customer addresses field, you have to edit the following code. 


line 412

set required to true and add new NotBlank message like the following.

->add('phone_mobile', TextType::class, [
'label' => $this->trans('Mobile phone', 'Admin.Global'),
'required' => true,
'constraints' => [
new NotBlank([
'message' => $this->trans(
'This field cannot be empty.', 'Admin.Notifications.Error'
new CleanHtml(),
new TypedRegex([
'type' => TypedRegex::TYPE_PHONE_NUMBER,
new Length([
'max' => AddressConstraint::MAX_PHONE_LENGTH,
'maxMessage' => $this->trans(
'This field cannot be longer than %limit% characters',
['%limit%' => AddressConstraint::MAX_PHONE_LENGTH]