示例#1
0
 /**
  * Display a list of all of the feeder's article.
  *
  * @param  Request  $request
  * @return Response
  */
 public function forFeeder(Request $request, Feeder $feeder)
 {
     $ret = array();
     $features = array();
     $ret["type"] = "FeatureCollection";
     foreach ($this->articles->forFeeder($feeder) as $article) {
         $features[] = array("type" => "Feature", "geometry" => array("type" => "Point", "coordinates" => array_map('floatval', explode(",", $article->location))), "properties" => array("name" => $article->title));
     }
     $ret["features"] = $features;
     return response()->json($ret);
 }