lcly-data-admin/app/Http/Requestes/RiceShrimpIndustryUpdateReq...

43 lines
1.1 KiB
PHP

<?php
namespace App\Http\Requestes;
use App\Rules\Quarter;
use Illuminate\Foundation\Http\FormRequest;
class RiceShrimpIndustryUpdateRequest extends FormRequest
{
/**
* Get the validation rules that apply to the request.
*
* @return array
*/
public function rules()
{
return [
'year' => ['filled', 'int'],
'quarter' => ['filled', new Quarter()],
'area' => ['filled', 'int', 'min:0'],
'area_unit' => ['filled', 'string'],
'product_output' => ['filled', 'int', 'min:0'],
'product_output_unit' => ['filled', 'string'],
'product_value' => ['filled', 'int', 'min:0'],
'product_value_unit' => ['filled', 'string'],
];
}
public function attributes()
{
return [
'year' => '年份',
'quarter' => '季度',
'area' => '面积',
'area_unit' => '面积单位',
'product_output' => '产量',
'product_output_unit' => '产量单位',
'product_value' => '产值',
'product_value_unit' => '产值单位',
];
}
}