rtrim(\implode(',', $fields), ',') ])); } }; return [ 'firstname' => [$atLeast, 'string', 'min:2'], 'lastname' => [$atLeast, 'string', 'min:2'], 'email' => [$atLeast, 'email:rfc,dns,spoof,filter'], 'password' => [ $atLeast, Password::min(8) ->mixedCase() ->letters() ->numbers() ->symbols() ->uncompromised() ], 'birth_date' => [$atLeast, 'date_format:Y-m-d'], 'address' => [$atLeast, 'required_with:address2', 'string'], 'address2' => ['sometimes', 'string'], 'phone' => [$atLeast, 'string'], 'country' => [ $atLeast, 'numeric', //phpcs:ignore Generic.CodeAnalysis.UnusedFunctionParameter.FoundInExtendedClassBeforeLastUsed function ($attribute, $value, $fail) { if (!\in_array($value, Country::toValues())) { $fail(trans('not_in')); } } ], 'city' => [$atLeast, 'string'], 'postcode' => [$atLeast, 'string'], 'opt_in' => [$atLeast, 'boolean'], ]; } }