Change GroupStore request validation

This commit is contained in:
Bubka 2023-06-30 15:19:47 +02:00
parent cb605cabbd
commit 9646afd2cc
2 changed files with 1 additions and 4 deletions

View File

@ -28,7 +28,7 @@ class GroupStoreRequest extends FormRequest
return [ return [
'name' => [ 'name' => [
'required', 'required',
'alpha_dash', 'regex:/^[a-zA-Z0-9\s\-_]+$/',
'max:32', 'max:32',
Rule::unique('groups')->where(fn ($query) => $query->where('user_id', $this->user()->id)), Rule::unique('groups')->where(fn ($query) => $query->where('user_id', $this->user()->id)),
], ],

View File

@ -105,9 +105,6 @@ class GroupStoreRequestTest extends FeatureTestCase
[[ [[
'name' => true, // string 'name' => true, // string
]], ]],
[[
'name' => 8, // string
]],
[[ [[
'name' => 'mmmmmmoooooorrrrrreeeeeeettttttthhhhhhaaaaaaannnnnn32cccccchhhhhaaaaaarrrrrrsssssss', // max:32 'name' => 'mmmmmmoooooorrrrrreeeeeeettttttthhhhhhaaaaaaannnnnn32cccccchhhhhaaaaaarrrrrrsssssss', // max:32
]], ]],