@php
if(auth()->user()->role->name == 'Sales Agent'){
$communications = App\Models\Communication::where(['lead_id'=> $lead->id, 'user_id' => auth()->user()->id])
->orderBy('created_at', 'Desc')
->get();
}else{
$communications = App\Models\Communication::where('lead_id', $lead->id)
->orderBy('created_at', 'Desc')
->get();
}
@endphp
@foreach ($communications as $communication)
@php
$date = strtotime($communication->event?->start);
$start = \Carbon\Carbon::createFromTimestamp($date);
@endphp
|
User Name:
|
@if (auth()->user()->type == 'admin' ||
auth()->user()->role->hasPermission('users-show'))
{{ $communication->user->name }}
@else
{{ $communication->user->name }}
@endif
|
|
Action Method:
|
{{ $communication->action_method }} |
|
Call Action:
|
{{ $communication->callAction->name }} |
|
Description:
|
{{ $communication->description }} |
|
Status:
|
{{ $communication->CommunicationStatus?->name }}
|
|
Created at:
|
{{ $communication->created_at }}
|
@if (!empty($communication->event))
|
Title:
|
{{ $communication->event?->title }}
|
|
Date of Next Action :
|
{{ $start }}
|
@endif
@endforeach