Well instead of passing the value you can pass in a ? or a string that represents the value
$cities = DB::select(DB::raw(' select concat(City, \', \',State) as displayText,
City as city, State as state,
min(( 3959 * acos(
cos( radians(:latitude) ) *
cos( radians( latitude ) ) *
cos( radians( longitude ) - radians(:longitude) ) +
sin( radians(:latitude) ) *
sin( radians( latitude ) ) ) )) AS distance
from locations
where city like ":city%"
group by city,state,displayText
order by distance asc',
[
'latitude' => $latitude,
'longitude' => $longitude,
'city' => $city,
]));
Instead of using the keyword you can also use ? instead of :latitude and :longitude. However you need to use the correct order of the parameters for each ?.