wyyl/beike/Admin/Http/Requests/LogisticsRequest.php

71 lines
2.3 KiB
PHP

<?php
/**
* PageRequest.php
*
* @copyright 2022 beikeshop.com - All Rights Reserved
* @link https://beikeshop.com
* @author Edward Yang <yangjin@guangda.work>
* @created 2022-08-19 21:58:20
* @modified 2022-08-19 21:58:20
*/
namespace Beike\Admin\Http\Requests;
use Illuminate\Foundation\Http\FormRequest;
class LogisticsRequest extends FormRequest
{
/**
* Determine if the user is authorized to make this request.
*
* @return bool
*/
public function authorize(): bool
{
return true;
}
/**
* Get the validation rules that apply to the request.
*
* @return array
*/
public function rules(): array
{
return [
'name' => 'string',
'warehouse_name' => 'string',
'country_id' => 'int',
'type' => 'string',
'first_weight' => 'numeric',
'first_weight_fee' => 'numeric',
'continuation_weight_max' => 'numeric',
'add_weight' => 'numeric',
'continuation_weight_fee' => 'numeric',
'num_fee' => 'numeric',
'throwing_ratio' => 'int',
'day_min' => 'int',
'day_max' => 'int',
];
}
public function attributes()
{
return [
'name' => trans('logistics.name'),
'warehouse_name' => trans('logistics.warehouse_name'),
'country_id' => trans('logistics.country_id'),
'type' => trans('logistics.type'),
'first_weight' => trans('logistics.first_weight'),
'first_weight_fee' => trans('logistics.first_weight_fee'),
'continuation_weight_max' => trans('logistics.continuation_weight_max'),
'add_weight' => trans('logistics.add_weight'),
'continuation_weight_fee' => trans('logistics.continuation_weight_fee'),
'num_fee' => trans('logistics.num_fee'),
'throwing_ratio' => trans('logistics.throwing_ratio'),
'day_min' => trans('logistics.day_min'),
'day_max' => trans('logistics.day_max'),
];
}
}