|
@@ -66,9 +66,10 @@ class MessageRuleController extends Controller
|
|
|
'title' => 'required|string|max:20',
|
|
|
'notice_groups' => 'required|string|max:31',
|
|
|
'message_type' => ['required',Rule::in('star', 'system')],
|
|
|
- 'message_show_type' => ['required',Rule::in('only_show', 'user', 'post', 'activity', 'topic')],
|
|
|
- 'activity_url' => 'required_unless:message_show_type,only_show|string|max:64',
|
|
|
- 'cover' => 'required|url',
|
|
|
+ 'message_show_type' => ['required_if:message_type,star',Rule::in('only_show', 'user', 'post', 'activity', 'topic')],
|
|
|
+ 'activity_url' => 'required_if:message_show_type,user,post,activity,topic|string|max:64',
|
|
|
+ 'content' => 'required_if:message_type,system|string|max:200',
|
|
|
+ 'cover' => 'required_if:message_type,star|url',
|
|
|
'send_time' => 'nullable|date',
|
|
|
'activity_time' => 'nullable|string|max:24',
|
|
|
]);
|
|
@@ -88,9 +89,10 @@ class MessageRuleController extends Controller
|
|
|
'title' => 'required|string|max:20',
|
|
|
'notice_groups' => 'required|string|max:31',
|
|
|
'message_type' => ['required',Rule::in('star', 'system')],
|
|
|
- 'message_show_type' => ['required',Rule::in('only_show', 'user', 'post', 'activity', 'topic')],
|
|
|
- 'activity_url' => 'required_unless:message_show_type,only_show|string|max:64',
|
|
|
- 'cover' => 'required|url',
|
|
|
+ 'message_show_type' => ['required_if:message_type,star',Rule::in('only_show', 'user', 'post', 'activity', 'topic')],
|
|
|
+ 'activity_url' => 'required_if:message_show_type,user,post,activity,topic|string|max:64',
|
|
|
+ 'content' => 'required_if:message_type,system|string|max:200',
|
|
|
+ 'cover' => 'required_if:message_type,star|url',
|
|
|
'send_time' => 'nullable|date',
|
|
|
'activity_time' => 'nullable|string|max:24',
|
|
|
]);
|