@foreach($customers as $value) @endforeach
Customer Name Customer Email Actions
{{ $value->name }} {{ $value->email }} @php $latestInst = $value->installations()->latest()->first(); $showConvert = !$latestInst || in_array(strtolower($latestInst->status), ['cancelled', 'canceled']); $actions = [ ['data-replace'=>'#editCustomer','url'=>'#editCustomerModal','ajax-url'=>url('/Backoffice/customers/'.$value->id.'/edit'), 'name'=>'Edit Lead', 'icon'=>'pencil'], ]; if ($showConvert) { $actions[] = ['url'=>url('/Backoffice/new/installations/'.$value->id), 'name'=>'Convert Customer', 'icon'=>'pencil']; } @endphp @include('partials.actions', ['actions'=>$actions])
@include('partials.pagination', ['items'=>$customers, 'index_route'=>route('customers.leads')])