public function index() { $filters = Input::only('parent'); if ($filters['parent'] != null) { $gplacesQuery = GPlace::where('importparent', $filters['parent']); } else { $gplacesQuery = GPlace::whereNull('importparent'); } $gplaces = $gplacesQuery->get(); return Response::json(array("data" => $gplaces, "parent" => $filters['parent'], 'status_code' => 200), 200); }
public function index() { $countries = GPlace::whereNull('importparent')->get(); $this->traverse($countries, [], false); return Response::json(array('status_code' => 200), 200); }