@php
$fullName = trim(
($lead->first_name ?? '') . ' ' . ($lead->middle_name ?? '') . ' ' . ($lead->last_name ?? ''),
);
@endphp
{{ $fullName ?: 'Lead Details' }}
Lead ID: {{ $lead->lead_id ?? ($lead->lead_code ?? $lead->id) }}
Status: {{ $lead->post_response ?? ($lead->status ?? 'N/A') }}
{{--
Source {{ $lead->source ?? 'N/A' }} --}}
Back to
Leads
@php
$attributes = $lead->getAttributes();
$priorityOrder = [
'lead_id',
'lead_code',
'first_name',
'middle_name',
'last_name',
'primary_phone_number',
'primary_email',
'phone_home',
'phone_work',
'phone_ext',
'address',
'address2',
'city',
'state',
'zip_code',
'county',
'country',
'country_code',
'email_address',
'dob',
'ip_address',
'type_of_coverage',
'household_size',
'household_income',
'gender',
'under_65',
'preexisting',
'status',
'advertiser_name',
'affiliate_name',
'campaign_name',
'offer_name',
'vertical_name',
'contract_name',
'source',
'assigned_to_user',
'company_id',
'company_name',
'vertical',
'dist_name',
'dist_id',
'payout',
'cost',
'click_id',
'lp_s1',
'lp_s2',
'lp_s3',
'lp_s4',
'lp_s5',
'lp_campaign_id',
'lp_campaign_key',
'lp_test',
'lp_response',
'trusted_form_cert_id',
'jornaya_lead_id',
'campaign_id',
'vertical_id',
'offer_id',
'affiliate_id',
'sellable',
'sold',
'paid',
'trash',
'post_response',
'contract_id',
'date_sold',
'tags',
'reason',
'timeline',
'tld_lead_created_at',
'tld_lead_modified_at',
'created_at',
'updated_at',
];
$excludedFields = [
'id',
'lead_id',
'lead_code',
'middle_name',
'fbclid',
'gclid',
'phone_home',
'phone_work',
'phone_ext',
'address2',
'county',
'preexisting',
'tags',
'trash',
'tld_lead_created_at',
'tld_lead_modified_at',
'source',
'assigned_to_user',
'impersonated_by',
'is_customer',
'company_name',
'vertical',
'lp_response',
'post_response',
'lp_test',
'lp_s1',
'lp_s2',
'lp_s3',
'lp_s4',
'lp_s5',
'lp_campaign_key',
'email_address',
'type',
'created_at',
'updated_at',
];
$excludeSuffixes = ['_id'];
$orderedAttributes = [];
foreach ($priorityOrder as $field) {
$hasExcludedSuffix = false;
foreach ($excludeSuffixes as $suffix) {
if (str_ends_with($field, $suffix)) {
$hasExcludedSuffix = true;
break;
}
}
if (
array_key_exists($field, $attributes) &&
!in_array($field, $excludedFields, true) &&
!$hasExcludedSuffix
) {
$orderedAttributes[$field] = $attributes[$field];
}
}
foreach ($attributes as $field => $value) {
$hasExcludedSuffix = false;
foreach ($excludeSuffixes as $suffix) {
if (str_ends_with($field, $suffix)) {
$hasExcludedSuffix = true;
break;
}
}
if (
!array_key_exists($field, $orderedAttributes) &&
!in_array($field, $excludedFields, true) &&
!$hasExcludedSuffix
) {
$orderedAttributes[$field] = $value;
}
}
@endphp