chore: use hex_color rule for color validation (#3936)

This commit is contained in:
Ngô Quốc Đạt 2024-01-19 18:09:22 +07:00 committed by GitHub
parent 0186ca909e
commit 734f4a150c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 2 additions and 1 deletions

View File

@ -18,6 +18,6 @@ class TagValidator extends AbstractValidator
'slug' => ['required', 'unique:tags', 'regex:/^[^\/\\ ]*$/i'],
'is_hidden' => ['bool'],
'description' => ['string', 'max:700'],
'color' => ['regex:/^#([a-f0-9]{6}|[a-f0-9]{3})$/i'],
'color' => ['hex_color'],
];
}

View File

@ -41,6 +41,7 @@ validation:
file: "The :attribute must be greater than or equal :value kilobytes."
string: "The :attribute must be greater than or equal :value characters."
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."
in: "The selected :attribute is invalid."
in_array: "The :attribute field does not exist in :other."