2019-10-29 15:33:36 +08:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\Http\Requests\Admin;
|
|
|
|
|
|
|
|
use Illuminate\Foundation\Http\FormRequest;
|
|
|
|
|
|
|
|
class PlanSave extends FormRequest
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* Get the validation rules that apply to the request.
|
|
|
|
*
|
|
|
|
* @return array
|
|
|
|
*/
|
|
|
|
public function rules()
|
|
|
|
{
|
|
|
|
return [
|
|
|
|
'name' => 'required',
|
|
|
|
'group_id' => 'required',
|
2019-11-04 01:51:16 +08:00
|
|
|
'transfer_enable' => 'required',
|
2020-01-03 19:12:05 +08:00
|
|
|
'month_price' => 'nullable|numeric',
|
|
|
|
'quarter_price' => 'nullable|numeric',
|
|
|
|
'half_year_price' => 'nullable|numeric',
|
|
|
|
'year_price' => 'nullable|numeric'
|
2019-10-29 15:33:36 +08:00
|
|
|
];
|
|
|
|
}
|
|
|
|
|
|
|
|
public function messages()
|
|
|
|
{
|
|
|
|
return [
|
|
|
|
'name.required' => '套餐名称不能为空',
|
|
|
|
'group_id.required' => '权限组不能为空',
|
2019-11-04 01:51:16 +08:00
|
|
|
'transfer_enable.required' => '流量不能为空',
|
2019-12-27 17:36:02 +08:00
|
|
|
'month_price.numeric' => '月付金额格式有误',
|
|
|
|
'quarter_price.numeric' => '季付金额格式有误',
|
|
|
|
'half_year_price.numeric' => '半年付金额格式有误',
|
|
|
|
'year_price.numeric' => '年付金额格式有误'
|
2019-10-29 15:33:36 +08:00
|
|
|
];
|
|
|
|
}
|
|
|
|
}
|