12 lines
796 B
PHP
12 lines
796 B
PHP
@foreach($answers as $key => $value)
|
|
@php
|
|
$field = $definition['fields'][$key] ?? [];
|
|
$empty = $value === null || $value === '' || $value === [];
|
|
$display = $empty ? 'Não informado' : (is_bool($value) ? ($value ? 'Sim' : 'Não') : (is_scalar($value) ? ($field['options'][(string) $value] ?? (string) $value) : json_encode($value, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES)));
|
|
if (!$empty && in_array($key, ['investment_amount', 'own_finance', 'other_finance'], true) && is_numeric($value)) {
|
|
$display = number_format((float)$value, 2, ',', ' ').' '.(($snapshot['payload']['currency'] ?? '') ?: '(moeda não informada)');
|
|
}
|
|
@endphp
|
|
<tr><th scope="row">{{ $field['label'] ?? \Illuminate\Support\Str::headline($key) }}</th><td>{{ $display }}</td></tr>
|
|
@endforeach
|