first version
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests\Customer;
|
||||
|
||||
use Modules\Common\Http\Requests\BaseFormRequest;
|
||||
|
||||
/**
|
||||
* 供应商 创建/编辑 验证
|
||||
*/
|
||||
class SupplierFormRequest extends BaseFormRequest
|
||||
{
|
||||
protected $stopOnFirstFailure = true;
|
||||
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'name' => 'required|string|max:100',
|
||||
'contact' => 'nullable|string|max:50',
|
||||
'phone' => 'nullable|string|max:20',
|
||||
'address' => 'nullable|string|max:255',
|
||||
'main_products' => 'nullable|string|max:255',
|
||||
'status' => 'nullable|integer|in:0,1',
|
||||
'remark' => 'nullable|string|max:255',
|
||||
];
|
||||
}
|
||||
|
||||
public function messages(): array
|
||||
{
|
||||
return [
|
||||
'name.required' => '供应商名称不能为空',
|
||||
'name.max' => '供应商名称最长 100 个字符',
|
||||
'status.in' => '状态值不正确',
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user