<?php

namespace App\Http\Requests\UserInvitation;

use Illuminate\Foundation\Http\FormRequest;

class AcceptInvitationRequest extends FormRequest
{
    public function authorize(): bool
    {
        return true;
    }

    public function rules(): array
    {
        return [
            'name' => ['required', 'string', 'max:100'],
            'password' => ['required', 'string', 'min:8', 'confirmed'],
            'phone' => ['nullable', 'string', 'max:20'],
        ];
    }

    public function messages(): array
    {
        return [
            'name.required' => __('validation.required', ['attribute' => '이름']),
            'password.required' => __('validation.required', ['attribute' => '비밀번호']),
            'password.min' => __('validation.min.string', ['attribute' => '비밀번호', 'min' => 8]),
            'password.confirmed' => __('validation.confirmed', ['attribute' => '비밀번호']),
        ];
    }
}
