mirror of
https://github.com/flarum/framework.git
synced 2024-11-25 17:57:04 +08:00
chore: use hex_color
rule for color validation (#3936)
This commit is contained in:
parent
0186ca909e
commit
734f4a150c
|
@ -18,6 +18,6 @@ class TagValidator extends AbstractValidator
|
||||||
'slug' => ['required', 'unique:tags', 'regex:/^[^\/\\ ]*$/i'],
|
'slug' => ['required', 'unique:tags', 'regex:/^[^\/\\ ]*$/i'],
|
||||||
'is_hidden' => ['bool'],
|
'is_hidden' => ['bool'],
|
||||||
'description' => ['string', 'max:700'],
|
'description' => ['string', 'max:700'],
|
||||||
'color' => ['regex:/^#([a-f0-9]{6}|[a-f0-9]{3})$/i'],
|
'color' => ['hex_color'],
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
|
@ -41,6 +41,7 @@ validation:
|
||||||
file: "The :attribute must be greater than or equal :value kilobytes."
|
file: "The :attribute must be greater than or equal :value kilobytes."
|
||||||
string: "The :attribute must be greater than or equal :value characters."
|
string: "The :attribute must be greater than or equal :value characters."
|
||||||
array: "The :attribute must have :value items or more."
|
array: "The :attribute must have :value items or more."
|
||||||
|
hex_color: "The :attribute field must be a valid hexadecimal color."
|
||||||
image: "The :attribute must be an image."
|
image: "The :attribute must be an image."
|
||||||
in: "The selected :attribute is invalid."
|
in: "The selected :attribute is invalid."
|
||||||
in_array: "The :attribute field does not exist in :other."
|
in_array: "The :attribute field does not exist in :other."
|
||||||
|
|
Loading…
Reference in New Issue
Block a user