Basic validation for tags slugs (#150)

* Co-authored-by  <sychocouldy@gmail.com>
This commit is contained in:
Alexander Skvortsov 2021-11-06 06:46:17 -04:00 committed by GitHub
parent cabe25acb4
commit c1069ff035

View File

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