public function ajaxCheckin() { if (isset(\Auth::user()->id)) { $location = Location::get(); $city = $location->cityName; $lat = $location->latitude; $lng = $location->longitude; $distance = 2000; //meters $limit = 8; //QUERY $term = Input::get('term'); $fb = \FacebookHelper::fb_init(); $response = $fb->get("/search?q={$term}&type=place¢er={$lat},{$lng}&distance={$distance}&limit={$limit}", \Auth::user()->access_token); $fb_response = $response->getDecodedBody(); $response_array = \FacebookHelper::fbResponse($fb_response['data']); return $response_array; } else { return "err: need login"; } }