예제 #1
0
 public function show($ubicacion_id)
 {
     //$ips = Ip::all()->toArray();
     if ($ubicacion_id == 0) {
         $ips = Ip::all()->toArray();
     } else {
         $ips = Ip::where('ubicacion_id', '=', $ubicacion_id)->get()->toArray();
     }
     while ($row = array_shift($ips)) {
         $json[] = $row['ip'];
     }
     $x = json_encode($json);
     $s = json_decode($x);
     //dd($s);
     //$datos = Ip::where('ip', '=', $ip);
     if ($ubicacion_id == 0) {
         return view('inventario::ip.libres')->with('ips', $s);
     } else {
         return view('inventario::ip.show')->with('ips', $s);
     }
 }