<?php
namespace App\Http\Repository\Customer;

use App\Models\Customer\CmnCustomer;

class CustomerRepository{

    public function getCustomerDropDown(){
        $data = CmnCustomer::select('id','full_name as name','phone_no')
                ->whereIn('id', function($query) {
                    $query->selectRaw('MIN(id)')
                        ->from('cmn_customers')
                        ->groupBy('full_name', 'phone_no');
                })
                ->orderBy('id','DESC')->get();

        return $data;
    }
}