I have an autocomplete input address using the Geo location of google map.Now, i want to compare that input address(string) to the lat and long being saved in the database so that any key word of the address matches to the database will be retrieved.How can i compare it since input is a string and lat and long are numeric?Hope anyone could help me out here.Thank you in advance!
scholar_table id name gender lat long 1 John Male 10.295866 123.889362 2 Joseph Male 10.352621 123.914448 3 Genrevel Female 10.331987 123.91059989999997
//Controller
public function address(Request $request){
$addrs = Input::get('address');
$scholars = (new Scholar)->newQuery()->select('*');
$scholars->where('lat','long', 'LIKE', '%'.$addrs.'%');
$scholars = $scholars->get();
}
from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/2kmWui0
via IFTTT
Aucun commentaire:
Enregistrer un commentaire