$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;
Asked
Active
Viewed 32 times
0

Dhairya Lakhera
- 4,445
- 3
- 35
- 62

Abu Sufyan
- 1
- 1
-
$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; – Abu Sufyan Apr 29 '22 at 09:45
-
and what is your question? – Mátyás Grőger Apr 29 '22 at 12:41
-
You may find this approach valuable https://aaronfrancis.com/2021/efficient-distance-querying-in-my-sql – Snapey Apr 29 '22 at 21:19