Is it possible to do such queries in ORM?
'SELECT *, ((lat-'.$lat.')*(lat-'.$lat.')+(lng-'.$lng.')*(lng-'.$lng.')) AS distance FROM addresses HAVING distance < "'.$d*$d*(0.000246176).'" ORDER BY distance'
Thanks
No. The ORM is not a query builder, it's an ORM.
You would use DB::select() or DB::query() to run custom queries. You might have to use DB::expr() in some places to deal with potential quoting issues in the calculation piece.