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

37 lines
866 B
PHP

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