@if ($new_task->assigned_to->count() > 0)
@foreach ($new_task->assigned_to as $view)
@php
$task_user = optional($view->head_office_user)->user;
@endphp
@if($task_user)
 }})
@if ($new_task->assigned_to->count() <= 3)
{{$view->head_office_user->user->name}}
@endif
@include('head_office.user_card_component', [
'user' => $task_user
])
@endif
@endforeach
@elseif (isset($new_task->assign_to) && $new_task->assign_to == 'everyone' && $new_task->shared_with == null)
Everyone
@if (isset($new_task->case))
@php
$involved_users = $new_task->case->getAllInvolvedUsers();
@endphp
@if (count($involved_users) > 0)
@foreach ($involved_users as $view)
@php
$task_user = optional($view)->user;
@endphp
@if($task_user)
 }})
@include('head_office.user_card_component', [
'user' => $task_user
])
@endif
@endforeach
@endif
@endif
@elseif (isset($new_task->assign_to) && $new_task->assign_to == 'specific_profiles')
Profiles
@if (isset($new_task->case))
@php
$involved_users = $new_task->getCaseProfileInvolvedUsers();
@endphp
@if (count($involved_users) > 0)
@foreach ($involved_users as $view)
@php
$task_user = optional($view)->user;
@endphp
@if($task_user)
 }})
@include('head_office.user_card_component', [
'user' => $task_user
])
@endif
@endforeach
@endif
@endif
@elseif ($new_task->ho_allocations->count() > 0)
@foreach ($new_task->ho_allocations as $view)
@php
$task_user = optional($view->head_office_user)->user;
@endphp
@if($task_user)
 }})
@if ($new_task->ho_allocations->count() <= 3)
{{$view->head_office_user->user->name}}
@endif
@include('head_office.user_card_component', [
'user' => $task_user
])
@endif
@endforeach
@elseif ($new_task->loc_allocations->count() > 0)
@foreach ($new_task->loc_allocations as $view)
@php
$location = optional($view->head_office_location)->location;
@endphp
@if($location)
{{$location->trading_name}}
@endif
@endforeach
@endif