{{-- select_from_array column --}} @php $values = data_get($entry, $column['name']); $box_class = ' '; if(isset($column['options'][$values]['box_class'])){ $box_class .= $column['options'][$values]['box_class']; } if(isset($column['model'])){ $model = $column['model']; }else{ $route = explode('/', $crud->route); $model = end($route); } if(isset($column['language_key'])){ $language_key = $column['language_key']; }else{ $language_key = $column['name']; } $_value = "-"; $value_prefix = ""; if ($values !== null) { if (is_array($values)) { $array_of_values = []; foreach ($values as $key => $value) { $_value = $value; if (is_array($value)) { if (isset($value['value'])) { $_value = $value['value']; } else { $_value = $value[0]; } } $array_of_values[] = $column['options'][$value]; } if (count($array_of_values) > 1) { $value_prefix = implode(', ', $array_of_values); } else { $value_prefix = $array_of_values; } } else { $_value = $values; if (is_array($values)) { if (isset($values['value'])) { $_value = $values['value']; } else { $_value = $values[0]; } } } } $text = !empty($column['options'][$_value]['text'])? $column['options'][$_value]['text'] : trans('backpack::' . $model . '.' . $language_key . '.' . $_value ); @endphp
{{ $value_prefix.$text }}