@@ -23,17 +23,17 @@ |
||
23 | 23 | 'branch_name' => 'required|exists:branches,name', |
24 | 24 | 'username' => 'required|string|max:255|unique:users,username', |
25 | 25 | 'fullname' => 'required|string|max:255', |
26 | - 'gender' => ['sometimes', 'nullable', Rule::in(Gender::toValues())], |
|
26 | + 'gender' => [ 'sometimes', 'nullable', Rule::in(Gender::toValues()) ], |
|
27 | 27 | 'email' => 'required|string|email|max:255|unique:users,email', |
28 | 28 | 'phone_country' => 'sometimes|in:ID', |
29 | - 'phone' => ['required', 'string', 'phone:ID', function ($attribute, $phone, $fail) { |
|
29 | + 'phone' => [ 'required', 'string', 'phone:ID', function($attribute, $phone, $fail) { |
|
30 | 30 | $user = User::where('phone', PhoneNumber::make($phone, request()->input('phone_country', env('PHONE_COUNTRY', 'ID')))->formatE164())->count(); |
31 | 31 | |
32 | 32 | if ($user > 0) { |
33 | - $fail(trans('validation.unique', ['attribute' => static::getAttributes()[$attribute]])); |
|
33 | + $fail(trans('validation.unique', [ 'attribute' => static::getAttributes()[ $attribute ] ])); |
|
34 | 34 | } |
35 | - }], |
|
36 | - 'password' => ['required', 'confirmed', Rules\Password::defaults()], |
|
35 | + } ], |
|
36 | + 'password' => [ 'required', 'confirmed', Rules\Password::defaults() ], |
|
37 | 37 | 'agree_with_terms' => 'required|boolean|in:1', |
38 | 38 | ]; |
39 | 39 | } |