fix: make phone number mandatory on registration and profile edit

This commit is contained in:
Valentin Lab
2026-02-09 09:16:37 +01:00
parent b763915211
commit 3d4496b253
3 changed files with 14 additions and 0 deletions

View File

@@ -119,6 +119,18 @@ class CustomerController extends Controller
{
$data = $request->all();
$validator = Validator::make($data, [
'phone' => 'required|max:30',
], [
'phone.required' => __('Le numéro de téléphone est obligatoire.'),
]);
if ($validator->fails()) {
return redirect()->route('Shop.Customers.edit')
->withInput()
->withErrors($validator->errors(), 'registration');
}
$passwordError = $this->handlePasswordChange($request);
if ($passwordError) {
return redirect()->route('Shop.Customers.edit')