Exemplo n.º 1
0
 public function getProduct()
 {
     return ProductVariant::where('id', $this->line_item_id)->first();
     //return $this->belongsTo('App\ProductVariant', 'line_item_id', 'id');
 }
Exemplo n.º 2
0
 /**
  * Show the form for editing the specified resource.
  *
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function edit($id)
 {
     $product = Product::find($id);
     $sub_cat = CategorySub::all();
     $variant = ProductVariant::where('id_products', $id)->get();
     $pict = Pict::where('id_products', $id)->get();
     $check = $product->publish;
     if ($check == 0) {
         $checks = '';
     } else {
         $checks = 'checked';
     }
     $categories = Category::all();
     return view('dropmin/product/edit')->with(array('product' => $product, 'sub_cat' => $sub_cat, 'variant' => $variant, 'check' => $checks, 'categories' => $categories, 'pict' => $pict));
 }