Skip to content

Commit ded8c9c

Browse files
authored
Update show_tabbed_fields.blade.php
1 parent 9ed23aa commit ded8c9c

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/resources/views/crud/inc/show_tabbed_fields.blade.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@
66
}
77
foreach(session()->get('errors')->getBags() as $bag => $errorMessages) {
88
foreach($errorMessages->getMessages() as $fieldName => $messages) {
9+
10+
# Transform subfield $fieldNames into the correct CRUD fieldName format
11+
# preg_split by the array separator .digits. and take only the first element
12+
$fieldName = preg_split('/\.\d+\./',$fieldName)[0];
13+
914
if(array_key_exists($fieldName, $crud->getCurrentFields()) && array_key_exists('tab', $crud->getCurrentFields()[$fieldName])) {
1015
return $crud->getCurrentFields()[$fieldName]['tab'];
1116
}

0 commit comments

Comments
 (0)