'required|string', 'image' => 'nullable|string', ]; } /** * 获取已定义验证规则的错误消息 */ public function messages(): array { return [ 'name.required' => '请填写直播间名称', ]; } /** * 验证的各字段的含义 * @return array|string[] */ public function attributes(): array { return [ 'name' => '直播间名称', 'image' => '直播间封面图', ]; } }