feat(auth): 회원가입 시 휴대폰·전화번호 선택 입력 추가

마이페이지·관리자 회원 폼에는 이미 연락처 필드가 있으나 회원가입 폼에만
빠져 두 화면이 불일치했다. DB·모델·Resource는 기존 존재하므로 회원가입
경로에만 검증·저장·입력 UI를 연결한다. 연락처는 선택 항목이다.
This commit is contained in:
chym1217 committed 2026-07-28 12:40:12 +09:00
1 parent eb0c72c32b
commit cd11fc60ce
18 files changed
+363 -6

No files matched your search

+11 -2
View File
@@ -4,6 +4,7 @@ namespace App\Http\Requests\Auth;
use App\Extension\HookManager;
use App\Models\User;
use Illuminate\Contracts\Validation\ValidationRule;
use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Validation\Rule;
@@ -11,6 +12,8 @@ class RegisterRequest extends FormRequest
{
/**
* Determine if the user is authorized to make this request.
*
* @return bool 항상 true (권한은 미들웨어 체인에서 처리)
*/
public function authorize(): bool
{
@@ -20,7 +23,7 @@ class RegisterRequest extends FormRequest
/**
* Get the validation rules that apply to the request.
*
* @return array<string, \Illuminate\Contracts\Validation\ValidationRule|array<mixed>|string>
* @return array<string, ValidationRule|array<mixed>|string>
*/
public function rules(): array
{
@@ -29,7 +32,9 @@ class RegisterRequest extends FormRequest
'nickname' => 'nullable|string|max:50',
'email' => ['required', 'string', 'email', 'max:255', Rule::unique(User::class)],
'password' => 'required|string|min:8|confirmed',
'language' => 'nullable|string|in:' . implode(',', config('app.supported_locales', ['ko', 'en'])),
'mobile' => ['nullable', 'string', 'max:20', 'regex:/^[0-9\-\+\(\)\s]+$/'],
'phone' => ['nullable', 'string', 'max:20', 'regex:/^[0-9\-\+\(\)\s]+$/'],
'language' => 'nullable|string|in:'.implode(',', config('app.supported_locales', ['ko', 'en'])),
'agree_terms' => 'accepted',
'agree_privacy' => 'accepted',
];
@@ -55,6 +60,10 @@ class RegisterRequest extends FormRequest
'password.required' => __('validation.auth.password.required'),
'password.min' => __('validation.auth.password.min'),
'password.confirmed' => __('validation.auth.password.confirmed'),
'mobile.max' => __('validation.auth.mobile.max'),
'mobile.regex' => __('validation.auth.mobile.regex'),
'phone.max' => __('validation.auth.phone.max'),
'phone.regex' => __('validation.auth.phone.regex'),
'agree_terms.accepted' => __('validation.auth.agree_terms.accepted'),
'agree_privacy.accepted' => __('validation.auth.agree_privacy.accepted'),
];