Skip to content

Commit d856673

Browse files
committed
in show_fields, use getFirstFieldView method
instead of manually doing the same thing in the blade file
1 parent a1376a1 commit d856673

File tree

1 file changed

+1
-13
lines changed

1 file changed

+1
-13
lines changed
Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,5 @@
11
{{-- Show the inputs --}}
22
@foreach ($fields as $field)
3-
@php
4-
// if the namespace is given, use that, no questions asked, otherwise
5-
// load it from the first view_namespace that holds that field
6-
if (isset($field['view_namespace'])) {
7-
$fieldPaths = [$field['view_namespace'].'.'.$field['type']];
8-
} else {
9-
$fieldPaths = array_map(function($item) use ($field) {
10-
return $item.'.'.$field['type'];
11-
}, config('backpack.crud.view_namespaces.fields'));
12-
}
13-
@endphp
14-
15-
@includeFirst($fieldPaths, ['field' => $field])
3+
@include($crud->getFirstFieldView($field['type'], $field['view_namespace'] ?? false), $field)
164
@endforeach
175

0 commit comments

Comments
 (0)