|
@@ 168-179 (lines=12) @@
|
| 165 |
|
}, $keys)); |
| 166 |
|
|
| 167 |
|
if ($field instanceof Field\Embeds) { |
| 168 |
|
$newRules = array_map(function ($v) use ($availInput, $field, $array_key_attach_str) { |
| 169 |
|
list($r, $k, $c) = explode('.', $v); |
| 170 |
|
$v = "{$r}.{$k}"; |
| 171 |
|
$embed = $field->getValidationRules([$field->column() => $availInput[$k][$c]]); |
| 172 |
|
return $embed ? $array_key_attach_str($embed, $v) : null; |
| 173 |
|
}, $newColumn); |
| 174 |
|
$rules = $array_clean_merge($rules, array_filter($newRules)); |
| 175 |
|
|
| 176 |
|
$newAttributes = array_map(function ($v) use ($availInput, $field, $array_key_attach_str) { |
| 177 |
|
list($r, $k, $c) = explode('.', $v); |
| 178 |
|
$v = "{$r}.{$k}"; |
| 179 |
|
$embed = $field->getValidationAttributes([$field->column() => $availInput[$k][$c]]); |
| 180 |
|
return $embed ? $array_key_attach_str($embed, $v) : null; |
| 181 |
|
}, $newColumn); |
| 182 |
|
$attributes = $array_clean_merge($attributes, array_filter($newAttributes)); |
|
@@ 176-187 (lines=12) @@
|
| 173 |
|
}, $newColumn); |
| 174 |
|
$rules = $array_clean_merge($rules, array_filter($newRules)); |
| 175 |
|
|
| 176 |
|
$newAttributes = array_map(function ($v) use ($availInput, $field, $array_key_attach_str) { |
| 177 |
|
list($r, $k, $c) = explode('.', $v); |
| 178 |
|
$v = "{$r}.{$k}"; |
| 179 |
|
$embed = $field->getValidationAttributes([$field->column() => $availInput[$k][$c]]); |
| 180 |
|
return $embed ? $array_key_attach_str($embed, $v) : null; |
| 181 |
|
}, $newColumn); |
| 182 |
|
$attributes = $array_clean_merge($attributes, array_filter($newAttributes)); |
| 183 |
|
|
| 184 |
|
$newInput = array_map(function ($v) use ($availInput, $field, $array_key_attach_str) { |
| 185 |
|
list($r, $k, $c) = explode('.', $v); |
| 186 |
|
$v = "{$r}.{$k}"; |
| 187 |
|
$embed = $field->getValidationInput([$field->column() => $availInput[$k][$c]]); |
| 188 |
|
return $embed ? $array_key_attach_str($embed, $v) : [null => 'null']; |
| 189 |
|
}, $newColumn); |
| 190 |
|
$newInputs = $array_clean_merge($newInputs, array_filter($newInput, 'strlen', ARRAY_FILTER_USE_KEY)); |
|
@@ 184-195 (lines=12) @@
|
| 181 |
|
}, $newColumn); |
| 182 |
|
$attributes = $array_clean_merge($attributes, array_filter($newAttributes)); |
| 183 |
|
|
| 184 |
|
$newInput = array_map(function ($v) use ($availInput, $field, $array_key_attach_str) { |
| 185 |
|
list($r, $k, $c) = explode('.', $v); |
| 186 |
|
$v = "{$r}.{$k}"; |
| 187 |
|
$embed = $field->getValidationInput([$field->column() => $availInput[$k][$c]]); |
| 188 |
|
return $embed ? $array_key_attach_str($embed, $v) : [null => 'null']; |
| 189 |
|
}, $newColumn); |
| 190 |
|
$newInputs = $array_clean_merge($newInputs, array_filter($newInput, 'strlen', ARRAY_FILTER_USE_KEY)); |
| 191 |
|
|
| 192 |
|
$newMessages = array_map(function ($v) use ($availInput, $field, $array_key_attach_str) { |
| 193 |
|
list($r, $k, $c) = explode('.', $v); |
| 194 |
|
$v = "{$r}.{$k}"; |
| 195 |
|
$embed = $field->getValidationMessages([$field->column() => $availInput[$k][$c]]); |
| 196 |
|
return $embed ? $array_key_attach_str($embed, $v) : null; |
| 197 |
|
}, $newColumn); |
| 198 |
|
$messages = $array_clean_merge($messages, array_filter($newMessages)); |
|
@@ 192-205 (lines=14) @@
|
| 189 |
|
}, $newColumn); |
| 190 |
|
$newInputs = $array_clean_merge($newInputs, array_filter($newInput, 'strlen', ARRAY_FILTER_USE_KEY)); |
| 191 |
|
|
| 192 |
|
$newMessages = array_map(function ($v) use ($availInput, $field, $array_key_attach_str) { |
| 193 |
|
list($r, $k, $c) = explode('.', $v); |
| 194 |
|
$v = "{$r}.{$k}"; |
| 195 |
|
$embed = $field->getValidationMessages([$field->column() => $availInput[$k][$c]]); |
| 196 |
|
return $embed ? $array_key_attach_str($embed, $v) : null; |
| 197 |
|
}, $newColumn); |
| 198 |
|
$messages = $array_clean_merge($messages, array_filter($newMessages)); |
| 199 |
|
} else { |
| 200 |
|
$fieldRules = is_array($fieldRules) ? implode('|', $fieldRules) : $fieldRules; |
| 201 |
|
$newRules = array_map(function ($v) use ($fieldRules, $availInput, $array_key_attach_str) { |
| 202 |
|
list($r, $k, $c) = explode('.', $v); |
| 203 |
|
//Fix ResetInput Function! A Headache Implementation! |
| 204 |
|
$col = explode(':', $c)[0]; |
| 205 |
|
if (array_key_exists($col, $availInput[$k]) && is_array($availInput[$k][$col])) { |
| 206 |
|
return $array_key_attach_str(preg_replace('/.+/', $fieldRules, $availInput[$k][$col]), $v, ':'); |
| 207 |
|
} |
| 208 |
|
|