{{ $record->form->name }}
Description:
{{ $record->form->note }}
Submitted:
{{ $record->created_at->format('d M Y (D) h:i a') }}
Completed By:
{{ $record->location->trading_name }}
,{{ isset($record->created_by) ? ($record->created_by->first_name . ' ' . $record->created_by->surname) : 'Quick login' }}
Unfortunately, the time period to submit further updates has passed. Please submit another form if you need to provide further information.
@elseif (isset($record->recorded_case) && $record->recorded_case->status == 'closed' && $record->form->allow_update_state != 'open')Case is Closed
@elseThis form does not allow updates. Please submit another form if you need to provide further information.
@endif-
@foreach ($json as $id => $changes)
@php
// Function to extract values
if (!function_exists('extractValues')) {
function extractValues($value) {
if (is_array($value) && !empty($value)) {
$flattened = [];
foreach ($value as $item) {
if (is_array($item)) {
if (!empty($item['vtm']['vtm_string'])) {
$flattened[] = $item['vtm']['vtm_string'];
}
if (!empty($item['other'])) {
$flattened[] = $item['other'];
}
} else {
$flattened[] = (string) $item;
}
}
return !empty($flattened) ? implode(', ', $flattened) : null;
}
return !empty($value) ? (string) $value : null;
}
}
// Extract values
$original_value = extractValues($changes['original']['value'] ?? null);
$modified_value = extractValues($changes['modified']['value'] ?? null);
// Skip rendering if both values are empty
if (empty($original_value) && empty($modified_value)) {
continue;
}
// Get details or fallback
$details = !empty($original_value) ? $record->get_question_details_by_id($id, $modification->parent_record_id, $original_value) : null;
$modified_details = !empty($modified_value) ? $record->get_question_details_by_id($id, $modification->parent_record_id, $modified_value) : null;
if (empty($details) && !empty($original_value)) {
$details = $original_value;
}
if (empty($modified_details) && !empty($modified_value)) {
$modified_details = $modified_value;
}
// Format results
$result = is_array($details) && !empty($details) ? implode(', ', array_map('strval', $details)) : ($details ?? 'N/A');
$modified_result = is_array($modified_details) && !empty($modified_details) ? implode(', ', array_map('strval', $modified_details)) : ($modified_details ?? 'N/A');
@endphp
-
Question: {{ $changes['original']['label'] ?? 'Unknown' }}
Response: {{ $result ?? 'N/A' }} → {{ $modified_result ?? 'N/A' }}
@endforeach
No modifications!
@endifDate
{{ $feedback->created_at->format('d/m/Y') }}
Reported
@isset($case_ids) @foreach ($case_ids as $case_id) @php $case = HeadOfficeCase::find($case_id)->first(); @endphp{{ $case->created_at->format('d/m/Y') }}
{{ $case->incident_type }}
{{ $case->location_name }}
Feedback by {{ $feedback->HeadOffice->name() }}
{!! isset($feedback->feedback_location) ? $feedback->feedback_location : $feedback->HeadOffice->name() . ' ' . "did'nt provided any feedback" !!}
No Feedbacks at the moment 🙂!
@endif