0

This is my senario: I saved order details against restaurant in mysql database in following way.

Id, order_no, name, lat, long etc and define radius of 5km of this order, now find the all locations of riders coming from real time database firebase. if someone (rider) gives his location in latitude and longitude to firebase. I needs to filler all the riders within 5km for order, i need to get latitude and longitude of rider from real time database firebase for track live location of rider

in here order is the center and radius is 5km and I need to find all the riders within that circle, my application is developed in laravel 5.8

can anyone help me.

Frank van Puffelen
  • 565,676
  • 79
  • 828
  • 807
Has Xan
  • 11
  • 1
  • Hello, to help others provide an answer please show what efforts you have made so far e.g. code, errors, etc... also please make your question about a specific issue in relation to your solution, thanks. – Badda_Bing Oct 12 '19 at 12:59

1 Answers1

0

The typical solution for this is using a library called GeoFire, which uses geohashes to accomplish the goal. There is however no existing GeoFire implementation for PHP. The best I can think of is doing this filtering from the client (in JavaScript), or you'll have to port the relevant parts of GeoFire to PHP yourself.

Also see

Frank van Puffelen
  • 565,676
  • 79
  • 828
  • 807