['parent_id', 'dept_name'], 'edit' => ['dept_id', 'parent_id', 'dept_name'], ]; /** * 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. */ public function rules(): array { return [ 'dept_id' => 'required', 'parent_id' => 'required', 'dept_name' => 'required' ]; } public function messages(): array { return [ 'dept_id.required' => '部门ID必填!', 'parent_id.required' => '上级ID必选!', 'dept_name.required' => '部门名称必填!' ]; } }