@extends('layouts.app') @section('title', 'All Leads') @push('css') @endpush @section('content') @use('Carbon\Carbon')
{{-- --}}
{{-- content section --}}

Manage Leads

{{-- pipeline code --}}
  • All
  • @forelse ($pipelines as $pipeline) @php // Determine the number of remaining pipeline items on the first loop if ($loop->first) { $class = 'w-25'; // Default class $remainingPipeLine = $loop->count % 7; // 7 is per page pipeline define in the js section } // Adjust class based on remaining items and modulo result if ( ($loop->remaining === 2 && $remainingPipeLine === 3) || ($loop->remaining === 1 && $remainingPipeLine === 2) ) { $class = 'w-50'; } elseif ($loop->remaining === 0 && $remainingPipeLine === 1) { $class = 'w-100'; } @endphp {{-- the data data-column attribute is used for the filtring the contact according to pipe line --}} {{-- the value of data-column is the cloumn index of the data table currently we are filtring the lead status ,the column number is --}} @empty @endforelse
{{-- table --}}
@forelse ($leads as $lead) @empty @endforelse
Name Address Type Company Email Phone Number Additional Phone Number Tags Lead Source Status Created By Assign To Referral Date Action
{{ $lead['f_name'] ?? '' }} {{ $lead['l_name'] ?? '' }} @if (!empty($lead['nick_name'])) {{ $lead['nick_name'] }} @endif {{ trim($lead['address'] ?? '') }}
{{ trim($lead['city'] ?? '') }}, {{ trim($lead['state'] ?? '') }} {{ trim($lead['zip_code'] ?? '') }}
{{ $lead['leadType'] ?? '-' }} {{ $lead['company'] ?? '-' }} {{ $lead['email'] ?? '-' }} {{ $lead['phone'] ?? '-' }} {{ $lead['additional_phone'] ?? '-' }} @php // Ensure tags is a valid JSON before decoding $tags = is_string($lead['tags']) ? json_decode($lead['tags'], true) : []; // Check if json_decode was successful and returned an array if (!is_array($tags)) { $tags = explode(",",$tags); // Set to empty array if decoding fails } @endphp @if (!empty($tags)) {{-- Show first two tags --}} @foreach(array_slice($tags, 0, 2) as $tag) {{ $tag }} @endforeach {{-- Show "More" button if more than 2 tags exist --}} @if (count($tags) > 2) @endif @else @endif @php $leadSource = ucfirst(str_replace("_", " ", trim($lead['lead_source']))); $displayText = strlen($leadSource) > 12 ? substr($leadSource, 0, 12) . '...' : $leadSource; @endphp {{ $displayText }} {{ $lead['lead_status'] ?? '-' }} {{ $lead['created_user']['f_name'] ?? '' }} {{ $lead['created_user']['l_name'] ?? '' }} {{ $lead['assigned_to']['f_name'] ?? 'Not Assigned' }} {{ $lead['referral_name'] ?? '-' }} {{ Carbon::parse($lead['created_at'])->format('Y-m-d') }}

No Lead Found

@include('layouts.includes.modals.lead.bulk_deleate')
@endsection @push('js') @endpush