コード例 #1
0
 /**
  * Update the specified resource in storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function update($id)
 {
     $typedevices = TypeDevice::find($id);
     if ($typedevices != null) {
         $vld = TypeDevice::validate(\Input::all(), $id);
         if ($vld->passes()) {
             $typedevices->update(\Input::all());
             return json_encode($typedevices);
         }
         return json_encode(array("Error" => $vld->messages()));
     }
 }