34 lines
704 B
PHP
34 lines
704 B
PHP
<?php
|
|
|
|
namespace App\Http\Requestes;
|
|
|
|
use App\Rules\Quarter;
|
|
use App\Rules\Year;
|
|
use Illuminate\Foundation\Http\FormRequest;
|
|
|
|
class RiceShrimpPriceUpdateRequest extends FormRequest
|
|
{
|
|
/**
|
|
* Get the validation rules that apply to the request.
|
|
*
|
|
* @return array
|
|
*/
|
|
public function rules()
|
|
{
|
|
return [
|
|
'year' => ['filled', 'int', new Year()],
|
|
'quarter' => ['filled', new Quarter()],
|
|
'price' => ['filled', 'int', 'min:0', 'max:2147483647'],
|
|
];
|
|
}
|
|
|
|
public function attributes()
|
|
{
|
|
return [
|
|
'year' => '年份',
|
|
'quarter' => '季度',
|
|
'price' => '价格',
|
|
];
|
|
}
|
|
}
|