@php use App\Models\Customer; $customer = Customer::join('instalasi', 'instalasi.id_customer', 'customer.id_customer')->where('customer.id_unit_instalasi', 60)->get(); @endphp @foreach ($customer as $cust) {{ $cust->nama }} - {{ $cust->handphone }} @php $customer_best_net = Customer::where('handphone', $cust->handphone) ->where('id_unit_instalasi', 24) ->first(); @endphp @if ($customer_best_net)
Best Net: {{ $customer_best_net->nama }} - {{ $customer_best_net->handphone }} @endif
@endforeach