@extends ('../welcome') @section('content') {{-- Main Card --}}
{{-- Main Header (btns) --}}
{{ $lead->name }}
@if (auth()->user()->type == 'admin' || auth()->user()->role->hasPermission('leads-makeCall')) @foreach ($lead->phone_numbers as $key => $phoneNumber) @php $countryCode = App\Models\Country::find($phoneNumber->country_id); $leadPhone = '0' . $phoneNumber->phone; @endphp @endforeach @endif @if (auth()->user()->type == 'admin' || auth()->user()->role->hasPermission('leads-edit')) @endif @if (auth()->user()->type == 'admin' || auth()->user()->role->hasPermission('leads-clientProfile')) @if ($lead->is_client == 0 || $lead->client_id == null) @else @endif @endif {{-- get history of lead --}} @if (auth()->user()->type == 'admin' || auth()->user()->role->hasPermission('leads-actionHistory')) @endif {{-- end history of lead --}} @if (auth()->user()->type == 'admin' || auth()->user()->role->hasPermission('leads-delete')) @if (empty($lead->client))    @endif @endif
{{-- Main Body --}}
{{-- General Data --}}
@if (!empty($lead->campaign)) @if (!empty($lead->project)) @endif @endif @if (!empty($lead->user_id)) @else @endif @if (!empty($lead->created_by_user)) @else @endif @if ($lastUser != null) @endif
Email : {{ $lead->email ?? '-' }}
Job Title : {{ $lead->job_title ?? '-' }}
Came From : {{ $lead->came_from ?? '' }}
Note : {{ $lead->note ?? '' }}
Purpose : {{ $lead->purpose ?? '' }}
Segment : {{ $lead->segment ?? '' }}
Tag : {{ $lead->tag ?? '' }}
Contact Tool : {{ $lead->contact_tool ?? '' }}
Reply Option : {{ $lead->reply_option ?? '' }}
Campaign : {{ $lead->campaign->name }}
Project : {{ $lead->project->name }}
Source : {{ $lead->source?->name ?? '' }}
Status : {{ $lead->LeadStatus?->name ?? '' }}
Assigned User : {{ $lead->user->name }} No Users Assigned To this lead
Created by : {{ $lead->created_by_user->name }}
Deadline : {{ $lastUser->deadline }}
{{-- Phone Number Card --}} @if (auth()->user()->type == 'admin' || auth()->user()->role->hasPermission('leads-phoneNumbers')) @if (auth()->user()->type == 'admin' || auth()->user()->role->hasPermission('leads-create-PhoneNumber')) @endif
@forelse($lead->phone_numbers as $phone) @empty

No Phone number Available for this Client

@endforelse
{{ $phone->country->phonecode }} {{ $phone->phone }} @if (auth()->user()->type == 'admin' || auth()->user()->role->hasPermission('leads-edit-phoneNumber')) @endif @if (auth()->user()->type == 'admin' || auth()->user()->role->hasPermission('leads-delete-phoneNumber')) @if (count($lead->phone_numbers) > 1) @endif @endif
@endif {{-- Assign User Card --}} @if (auth()->user()->type == 'admin' || auth()->user()->role->hasPermission('leads-assignUsers'))
@csrf
@endif {{-- Comments and Stream --}} @if (auth()->user()->type == 'admin' || auth()->user()->role->hasPermission('leads-comments'))
@if (auth()->user()->type == 'admin' || auth()->user()->role->hasPermission('leads-create-comment')) @endif
Comments
@foreach ($lead->streams as $stream) @csrf @method('PUT') @if ($stream->created_at != $stream->updated_at) @endif @endforeach
Comment:
Created by: {{ $stream->creator->name ?? '' }}
Created at: {{ $stream->created_at ?? '' }}
Updated at: {{ $stream->updated_at ?? '' }}
Actions @if (auth()->user()->type == 'admin' || auth()->user()->role->hasPermission('leads-edit-comment')) @endif @if (auth()->user()->type == 'admin' || auth()->user()->role->hasPermission('leads-delete-comment')) @endif
@endif
{{-- Communications Card --}}
Call Action @if (auth()->user()->type == 'admin' || auth()->user()->role->hasPermission('leads-actionHistory')) @endif
@csrf


{{-- Communications history Modal --}} {{-- Lead History Modal --}} {{-- Delete Modal --}} {{-- Delete Phone Number Modal --}} {{-- Store Phone Number --}} {{-- Store Comment --}} {{-- Delete comment Modal --}} @endsection