Exemplo n.º 1
0
 public function updateCatalogOrderItems()
 {
     $data = Input::get('data');
     foreach ($data as $dataItem) {
         $productLine = null;
         if ($dataItem['type'] == 'Priola\\ProductLine') {
             $itemToSave = ProductLine::findOrFail($dataItem['id']);
         } else {
             $itemToSave = Product::findOrFail($dataItem['id']);
         }
         $itemToSave->catalog_order = $dataItem['order'];
         $itemToSave->save();
     }
     return response("ok");
 }
Exemplo n.º 2
0
 public function product($id)
 {
     return view('home.catalog.product', ['product' => Product::findOrFail($id)]);
 }