AdminAuth::changeIdentifier() registers two routes. Register them in an authenticated group, and enable OTP codes.
routes/api.php
- The app sends the new value, e.g.
{"verificator": "phone", "phone": "+421900123456"}. It is validated with the rules of the field in the user model, so the uniqueness rule applies. The code is valid for 60 minutes. - The app sends the code. The new value is saved only when no other account took it in the meantime.
Customizing the controller
app/Http/Controllers/Auth/IdentifierController.php
getIdentifierChangedMessage($field).