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

37 lines
857 B
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'],
'product_output' => ['filled', 'int', 'min:0'],
'product_value' => ['filled', 'int', 'min:0'],
];
}
public function attributes()
{
return [
'year' => '年份',
'quarter' => '季度',
'area' => '面积',
'product_output' => '产量',
'product_value' => '产值',
];
}
}