@if($feedbacks->count() > 0)
@foreach ($feedbacks as $feedback)
@php
$cases = $feedback->cases();
$involvedCases = collect();
$otherCases = collect();
foreach ($cases as $case) {
$involvedLocations = $case->link_case_with_form?->getInvolvedLocations();
$locationInvolved = $involvedLocations && $involvedLocations->contains('id', $location->id);
if ($locationInvolved) {
$involvedCases->push($case);
} else {
$otherCases->push($case);
}
}
// Create searchable text
$searchableText = strtolower($location->trading_name . ' ' . strip_tags($feedback->feedback_location));
if ($involvedCases->count() > 0) {
$searchableText .= ' ' . $involvedCases->pluck('id')->implode(' ');
}
if ($otherCases->count() > 0) {
$searchableText .= ' ' . $otherCases->pluck('id')->implode(' ');
}
@endphp
{{$location->trading_name}}
{!! $feedback->feedback_location !!}
Feedback Date: {{ $feedback->created_at ? $feedback->created_at->format('M d, Y \a\t g:i A') : 'N/A' }}
@if($involvedCases->count() > 0)
Site submission ({{ $involvedCases->count() }})
@foreach ($involvedCases as $case)
Case ID: {{ $case->id ?? 'N/A' }}
Created: {{ $case->created_at ? $case->created_at->format('M d, Y') : 'N/A' }}
@endforeach
@endif
@if($otherCases->count() > 0)
Other Cases Submissions ({{ $otherCases->count() }})
@foreach ($otherCases as $case)
Case ID: {{ $case->id ?? 'N/A' }}
Created: {{ $case->created_at ? $case->created_at->format('M d, Y') : 'N/A' }}
@endforeach
@endif
@endforeach
@else
No feedback available
There are currently no feedback submissions to display.
@endif
No results found
Try adjusting your search terms or browse all feedback.