Skip to content

Commit

Permalink
Min/max lenght for description on categories
Browse files Browse the repository at this point in the history
  • Loading branch information
rowasc committed May 22, 2020
1 parent c295f2a commit e3f6e2b
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions v4/Models/Category.php
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,16 @@ public static function validationMessages()
'validation.regex',
['field' => trans('fields.description')]
),

'description.min' => trans(
'validation.min_length',
['field' => trans('fields.description')]
),

'description.max' => trans(
'validation.max_length',
['field' => trans('fields.description')]
),
'icon.regex' => trans(
'validation.regex',
['field' => trans('fields.icon')]
Expand Down Expand Up @@ -182,10 +192,9 @@ public function getRules()
// 'regex:'.LegacyValidator::REGEX_STANDARD_TEXT,
],
'description' => [
'regex:/^[\pL\pN\pP ]++$/uD'
// 'min:2',
// 'max:255',
// 'regex:'.LegacyValidator::REGEX_STANDARD_TEXT,
'regex:/^[\pL\pN\pP ]++$/uD',
'min:2',
'max:255',
],
// 'color' => [
// ['color'],
Expand Down

0 comments on commit e3f6e2b

Please sign in to comment.