fix validation
This commit is contained in:
parent
e6252c49d1
commit
ab960cda7c
@ -32,11 +32,11 @@ class WebhookController extends Controller
|
|||||||
'note' => 'nullable|string|max:500',
|
'note' => 'nullable|string|max:500',
|
||||||
'link' => 'nullable|url|max:2000',
|
'link' => 'nullable|url|max:2000',
|
||||||
'tags' => 'nullable|array',
|
'tags' => 'nullable|array',
|
||||||
'tags.*' => ['string', 'not_regex:/\s/u'],
|
'tags.*' => ['string', 'not_regex:/[\s\r\n]/u', 'max:255'],
|
||||||
'is_private' => 'nullable|boolean',
|
'is_private' => 'nullable|boolean',
|
||||||
'is_too_sensitive' => 'nullable|boolean',
|
'is_too_sensitive' => 'nullable|boolean',
|
||||||
], [
|
], [
|
||||||
'tags.*.not_regex' => 'The :attribute cannot contain spaces.'
|
'tags.*.not_regex' => 'The :attribute cannot contain spaces, tabs and newlines.'
|
||||||
]);
|
]);
|
||||||
|
|
||||||
if ($validator->fails()) {
|
if ($validator->fails()) {
|
||||||
|
Loading…
Reference in New Issue
Block a user