Skip to content

Commit b420222

Browse files
committed
Profile: add phone number verification
fix #210
1 parent 41cdfb3 commit b420222

File tree

6 files changed

+241
-4
lines changed

6 files changed

+241
-4
lines changed

app/Http/Controllers/Auth/RegisterController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ protected function validator(array $data)
8686
'addressCity' => 'required|max:100',
8787
'addressCounty' => 'required|max:100',
8888
'addressPostcode' => 'required|max:10',
89-
'contactNumber' => 'required|max:50',
89+
'contactNumber' => 'required|max:50|phone:AUTO,GB',
9090
'dateOfBirth' => 'nullable|date_format:Y-m-d',
9191
]);
9292
}

app/Http/Controllers/MembershipController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ public function updateDetails(User $user, Request $request)
237237
'addressCity' => 'required|max:100',
238238
'addressCounty' => 'required|max:100',
239239
'addressPostcode' => 'required|max:10',
240-
'contactNumber' => 'required|max:50',
240+
'contactNumber' => 'required|max:50|phone:AUTO,GB',
241241
'dateOfBirth' => 'nullable|date_format:Y-m-d',
242242
]);
243243

app/Http/Controllers/UserController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ public function update(Request $request, User $user)
119119
'addressCity' => 'sometimes|required|max:100',
120120
'addressCounty' => 'sometimes|required|max:100',
121121
'addressPostcode' => 'sometimes|required|max:10',
122-
'contactNumber' => 'sometimes|required|max:50',
122+
'contactNumber' => 'sometimes|required|max:50|phone:AUTO,GB',
123123
'dateOfBirth' => 'sometimes|nullable|date_format:Y-m-d',
124124
'unlockText' => 'sometimes|nullable|max:95',
125125
]);

composer.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
"pragmarx/google2fa-laravel": "^1.0",
3232
"pragmarx/recovery": "^0.1.0",
3333
"predis/predis": "^1.1",
34+
"propaganistas/laravel-phone": "^4.2",
3435
"spatie/laravel-cookie-consent": "^2.0",
3536
"tremby/laravel-git-version": "^1.1"
3637
},

composer.lock

Lines changed: 236 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

resources/lang/en/validation.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@
9393
'not_in' => 'The selected :attribute is invalid.',
9494
'not_regex' => 'The :attribute format is invalid.',
9595
'numeric' => 'The :attribute must be a number.',
96+
'phone' => 'The :attribute field contains an invalid number.',
9697
'present' => 'The :attribute field must be present.',
9798
'regex' => 'The :attribute format is invalid.',
9899
'required' => 'The :attribute field is required.',

0 commit comments

Comments
 (0)