first version

This commit is contained in:
liu
2026-07-23 20:41:25 +08:00
parent 00a0938a1b
commit 10cff754a4
211 changed files with 11577 additions and 842 deletions
@@ -0,0 +1,39 @@
<?php
namespace App\Http\Requests\Customer;
use Modules\Common\Http\Requests\BaseFormRequest;
/**
* 通知 创建 验证(user_id 留空 = 全员广播)
*/
class NoticeFormRequest extends BaseFormRequest
{
protected $stopOnFirstFailure = true;
protected function prepareForValidation(): void
{
$this->merge(['user_id' => (int) ($this->input('user_id') ?? 0)]);
}
public function rules(): array
{
return [
'user_id' => 'required|integer|min:0',
'type' => 'required|string|in:order,price,system',
'title' => 'required|string|max:100',
'content' => 'nullable|string|max:500',
];
}
public function messages(): array
{
return [
'type.required' => '通知类型不能为空',
'type.in' => '通知类型只能是 order/price/system',
'title.required' => '通知标题不能为空',
'title.max' => '通知标题最长 100 个字符',
'content.max' => '通知内容最长 500 个字符',
];
}
}