<?php

namespace Modules\User\Http\Requests;

use Illuminate\Foundation\Http\FormRequest;

class UpdateUserInfoRequest extends FormRequest
{

    public function rules(): array
    {
        return [
            'nickname' => 'required',
            'avatar'   => ['regex:/[^\s]*\.(jpg|jpeg|gif|png)$/i'],
        ];
    }

    public function messages(): array
    {
        return [
            'nickname.required' => '用户昵称必须填写',
            'avatar.regex'      => '头像地址格式不正确',
        ];
    }

}