Searching a table in MySQL based on latitude and longitude columns. But how do you make this as efficient as possible? So, Aaron Francis from PlanetScale made a video about this: Here is the scope you can use in your Laravel application: public function scopeDistanceSphere($query, $lat, $lng, $radiusInMeter = 100) { $offsetOneMeter = 0.000111; $radiusOffset = ($radiusInMeter * $offsetOneMeter) + $offsetOneMeter; $latOffsetMinus = $lat - $radiusOffset; $latOffsetPlus = $lat + $radiusOffset; $lngOffsetMinus = $lng - $radiusOffset; $lngOffsetPlus = $lng + $radiusOffset; return $query ->whereBetween('lat', [$latOffsetMinus, $latOffsetPlus]) ->whereBetween('lng', [$lngOffsetMinus, $lngOffsetPlus]) ->whereRaw(" ST_distance_sphere( point($lng, $lat), point(lng, lat)) > $radiusInMeter "); } Thanks to my colleague https://nl.linkedin.com/in/coen-de-rijter-220b82231, for making this scope.