Let the database make as much filtering as possible. You can do this in SQL.
select * from technicians as t where (t.long- custLong)*(t.long- custLong) + (t.lat- custLat)*(t.lat- custLat) < t.max*t.max
The right side is km^2, but the left isn't take care of it.
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community