public function getColor($id)
 {
     return detailproduct::select("color")->where('productID', '=', $id)->get();
 }
 public function detail()
 {
     $productdetail = detailproduct::find(Input::get('idedit'));
     if (Input::exists('images')) {
         $images = "";
         foreach (Input::get('images') as $key => $value) {
             if ($value != "") {
                 $images .= $value . ",";
             }
         }
         if ($images != "") {
             $length = strlen($images);
             $images = substr($images, 0, $length - 1);
             $productdetail->images = $images;
         }
     }
     if (Input::exists('silebar_images')) {
         $silebar_images = "";
         foreach (Input::get('silebar_images') as $key => $value) {
             if ($value != "") {
                 $silebar_images .= $value . ",";
             }
         }
         if ($silebar_images != "") {
             $length = strlen($silebar_images);
             $silebar_images = substr($silebar_images, 0, $length - 1);
             $productdetail->silebar_images = $silebar_images;
         }
     }
     $productdetail->infomation = Input::get('infomation');
     $productdetail->size = Input::get('size');
     $productdetail->color = Input::get('color');
     $productdetail->data_sheet = Input::get('data_sheet');
     if ($productdetail->update()) {
         return Redirect::to('admin/product/edit?id=' . Input::get('idproductedit') . '#detail')->with(['message' => 'Cập nhật thành công chi tiết sản phẩm "' . Input::get('nameproductedit') . '"']);
     } else {
         return Redirect::to('admin/product/edit?id=' . Input::get('idproductedit') . '#detail')->with(['message' => 'Cập nhật chi tiết sản phẩm "' . Input::get('nameproductedit') . '" thất bại. Vui lòng thử lại']);
     }
 }
 public static function getDetailProduct($productID)
 {
     $detailproduct = new detailproduct();
     return $detailproduct->where('productID', '=', $productID)->get();
 }