mzm-dev

Untitled

Apr 20th, 2016
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. public function source()
  2. {
  3. $maps = Map::all();
  4. $arr = [];
  5.  
  6. foreach($maps as $map) {
  7. $arr['markers'][] = [
  8. 'title' => $map->article->short_title_english,
  9. 'lat' => $map->latitude,
  10. 'lng' => $map->longitude,
  11. 'description' => $map->description_english,
  12. 'status' => $map->status,
  13. 'icon' => $map->icon
  14. ];
  15. }
  16. echo json_encode($arr);
  17. }
Advertisement
Add Comment
Please, Sign In to add comment