You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
67 lines
1.6 KiB
67 lines
1.6 KiB
<?php
|
|
|
|
namespace App\Http\Requests\Registration;
|
|
|
|
use App\Dictionary\Patient\IdentifyCardType;
|
|
use Illuminate\Contracts\Validation\ValidationRule;
|
|
use Illuminate\Foundation\Http\FormRequest;
|
|
|
|
class RegisterRequest extends FormRequest
|
|
{
|
|
/**
|
|
* Determine if the user is authorized to make this request.
|
|
*/
|
|
public function authorize(): bool
|
|
{
|
|
return true;
|
|
}
|
|
|
|
/**
|
|
* Get the validation rules that apply to the request.
|
|
*
|
|
* @return array<string, ValidationRule|array|string>
|
|
*/
|
|
/**
|
|
* 规则
|
|
* @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' => '挂号时间段',
|
|
];
|
|
}
|
|
}
|
|
|