*/ /** * 规则 * @return array */ public function rules(): array { return [ 'date' => 'required|date_format:Y-m-d||after_or_equal:today', 'dept_id' => 'required', 'doctor_id' => 'required', 'reg_id' => 'required' ]; } /** * 错误提示语句 * @return array */ public function messages(): array { return [ 'date.required' => '必须选择挂号日期', 'date.date_format' => '必须选择挂号日期', 'date.after_or_equal' => '挂号日期不得小于今天', 'dept_id.required' => '必须选择挂号科室', 'doctor_id.required' => '必须选择挂号医生', 'reg_id.required' => '必须选择挂号时间段', ]; } /** * 字段名称 * @return array */ public function attributes(): array { return [ 'date' => '挂号日期', 'dept_id' => '挂号科室', 'doctor_id' => '挂号医生', 'reg_id' => '挂号时间段', ]; } }