'Convert latlng raw query to Eloquent query

$markerResult = Accommodation::with('images')
    ->whereRaw($lat <= (`lat`+(0.00898315284 * $radius)))
    ->whereRaw($lat >= (`lat`-(0.00898315284 * $radius)))
    ->whereRaw($lng <= (`lng`+(0.00898315284 * $radius)))
    ->whereRaw($lng >= (`lng`-(0.00898315284 * $radius)))
    ->paginate(Config::get('global.pagination_records'));
return $markerResult;


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source