In the file app/Http/Controllers/UserController.php find the funtion "loginWithOtp"
there, in the else part (where the new user is to be registered), you will find this:
$payload = [
'password' => Hash::make($randomPassword),
'email' => $request->email,
'name' => $request->name,
'phone' => $request->phone,
'auth_token' => '',
'user_ip' => $request->ip(),
];
Change this to:
$payload = [
'password' => Hash::make($randomPassword),
'email' => str_replace('+', '', $request->phone) . '@' . $request->getHttpHost();,
'name' => $request->name,
'phone' => $request->phone,
'auth_token' => '',
'user_ip' => $request->ip(),
];
I think that's it for the Backend part.
The front is much simpler, just need to remove the required file in the email field. (Can only provide the solution for Extended License, for the regular license, you will need to dig into the static/js folder)
In the file: src\components\Mobile\Auth\OtpLogin\index.js
Line: 77 remove code: && this.validator.fieldValid("email")
Line: 380 remove code: {this.validator.message("email", this.state.email, "required|email")}