35 lines
726 B
PHP
35 lines
726 B
PHP
<?php
|
|
|
|
namespace App\Http\Requestes;
|
|
|
|
use App\Rules\Quarter;
|
|
use Illuminate\Foundation\Http\FormRequest;
|
|
|
|
class RiceShrimpFlowUpdateRequest 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'],
|
|
'sales' => ['filled', 'int', 'min:0'],
|
|
];
|
|
}
|
|
|
|
public function attributes()
|
|
{
|
|
return [
|
|
'year' => '年份',
|
|
'quarter' => '季度',
|
|
'area' => '地区',
|
|
'sales' => '销量',
|
|
];
|
|
}
|
|
}
|