Skip to content

Commit

Permalink
Issue krayin#61 fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
jitendra-webkul committed Jun 23, 2021
1 parent 6ac6873 commit cd18a3b
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,27 @@
@php
$validations = [];
if ($attribute->is_required) {
array_push($validations, 'required');
}
if ($attribute->code != 'sku') {
if ($attribute->is_required) {
array_push($validations, 'required');
}
if ($attribute->type == 'price') {
array_push($validations, 'decimal');
}
if ($attribute->type == 'price') {
array_push($validations, 'decimal');
}
array_push($validations, $attribute->validation);
array_push($validations, $attribute->validation);
$validations = implode('|', array_filter($validations));
} else {
$validations = "{ ";
$validations = implode('|', array_filter($validations));
if ($attribute->is_required) {
$validations .= "required: true, ";
}
$validations .= "regex: /^[a-z0-9]+(?:-[a-z0-9]+)*$/ }";
}
@endphp

@if (view()->exists($typeView = 'admin::common.custom-attributes.edit.' . $attribute->type))
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<input type="text" v-validate="'{{$validations}}'" class="control" id="{{ $attribute->code }}" name="{{ $attribute->code }}" value="{{ old($attribute->code) ?: $value }}" data-vv-as="&quot;{{ $attribute->name }}&quot;" />
<input type="text" @if ($attribute->code == 'sku') v-validate="{{$validations}}" @else v-validate="'{{$validations}}'" @endif class="control" id="{{ $attribute->code }}" name="{{ $attribute->code }}" value="{{ old($attribute->code) ?: $value }}" data-vv-as="&quot;{{ $attribute->name }}&quot;" />

0 comments on commit cd18a3b

Please sign in to comment.