fixed validation

This commit is contained in:
Edward Yang 2022-08-19 21:14:12 +08:00
parent f0dd991d1e
commit d670a46c32
3 changed files with 35 additions and 13 deletions

View File

@ -35,7 +35,17 @@ class TaxRateRequest extends FormRequest
return [
'name' => 'required|string|max:10',
'rate' => 'required|numeric',
'type' => 'required|'
'type' => 'required|in:percent,flat',
'region_id' => 'required|int',
];
}
public function attributes()
{
return [
'name' => trans('validation.attributes.tax_rate.name'),
'rate' => trans('validation.attributes.tax_rate.rate'),
'type' => trans('validation.attributes.tax_rate.type'),
];
}
}

View File

@ -158,6 +158,12 @@ return [
'attributes' => [
'descriptions.en.title' => 'Title',
'descriptions.zh_cn.title' => 'Title',
'tax_rate' => [
'name' => 'Tax Rate Name',
'type' => 'Tax Type',
'rate' => 'Tax Rate',
]
],
];

View File

@ -158,6 +158,12 @@ return [
'attributes' => [
'descriptions.en.title' => '英文标题',
'descriptions.zh_cn.title' => '中文标题',
'tax_rate' => [
'name' => '税种名称',
'type' => '类型',
'rate' => '税率',
]
],
];