$paginate = DB::table('customers')
->where($where)
// ->selectRaw("id, longitude, latitude,name,contact, ROUND(ST_DISTANCE(point(longitude, latitude), point({$log}, {$lat})) *111195,2) distance")
->selectRaw("id, longitude, latitude,name,contact,(2 * 6371 * ASIN(SQRT(POWER(SIN((RADIANS($lat) - RADIANS(`latitude`)) / 2), 2) + COS(RADIANS($lat)) * COS(RADIANS(`latitude`)) * POWER(SIN((RADIANS($lng) - RADIANS(`longitude`)) / 2), 2)))) AS distance")
->orderBy('distance','asc')
->paginate($input['size']);