'nullable|string|min:2|max:20', 'id_card' => 'nullable|string|size:18', 'id_card_front_photo' => 'required|string|max:2048', 'id_card_back_photo' => 'required|string|max:2048', 'id_card_hand_photo' => 'required|string|max:2048', ]; } public function messages() { return [ 'real_name.string' => '姓名必须是字符串', 'real_name.min' => '姓名不能少于2个字符', 'real_name.max' => '姓名不能超过20个字符', 'id_card.size' => '身份证号必须是18位', 'id_card_front_photo.required' => '身份证正面照片不能为空', 'id_card_front_photo.max' => '身份证正面照片数据过大', 'id_card_back_photo.required' => '身份证反面照片不能为空', 'id_card_back_photo.max' => '身份证反面照片数据过大', 'id_card_hand_photo.required' => '手持身份证照片不能为空', 'id_card_hand_photo.max' => '手持身份证照片数据过大', ]; } }