['filled', 'int', new Year()], 'quarter' => ['filled', new Quarter()], 'name' => ['filled', 'string', 'max:255'], 'type' => ['filled', new Enum(MaterielType::class)], 'lowest_price' => ['filled', 'numeric', 'min:0', 'max:9999999999.99', 'regex:/^([1-9]\d*|0)(\.\d{1,2})?$/'], 'highest_price' => ['filled', 'numeric', 'min:0', 'max:9999999999.99', 'regex:/^([1-9]\d*|0)(\.\d{1,2})?$/', 'gte:lowest_price'], 'unit' => ['filled', 'string'], ]; } public function attributes() { return [ 'year' => '年份', 'quarter' => '季度', 'name' => '名称', 'type' => '类型', 'lowest_price' => '最低价', 'highest_price' => '最高价', 'unit' => '单位', ]; } }