@if (isset($all_linked_contacts) && count($all_linked_contacts) > 0) @foreach ($all_linked_contacts as $contact) @php if ($contact == null) { continue; } @endphp @php $contactSections = [ 'home_address', 'work_address', 'temporary_address', 'billing_address', 'shipping_address', 'alternate_address', ]; @endphp @foreach ($contactSections as $contact_key) @if (!empty($contact->$contact_key))

Address

{{ $contact->$contact_key }}
@isset($case->location->location_tag)
@livewire('intelligence-contact-tags', ['contact_id' => $contact->id])
@endisset
@php $commentValue = optional( $comments ->where('card_id', $contact->id) ->where('case_id', $case->id) ->where('type', $contact_key) ->first(), )->comment; @endphp
@endif @endforeach @endforeach @endif {{-- if address involved from button --}} @php $inv_addresses = $case->case_to_involvements->where('type', 'address'); @endphp @if ($inv_addresses->isNotEmpty()) @foreach ($inv_addresses as $each_address) @php $address = App\Models\new_contact_addresses::find($each_address->type_id); @endphp @if ($address)

Address

{{ $address->address }}
{{-- @isset($case->location->location_tag)
@livewire('intelligence-contact-tags', ['contact_id' => $address->id])
@endisset --}}
@php $commentValue = optional( $comments ->where('card_id', $address->id) ->where('case_id', $case->id) ->where('type', 'inv_address') ->first(), )->comment; @endphp
@endif @endforeach @endif