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"); }
public function product($id) { return view('home.catalog.product', ['product' => Product::findOrFail($id)]); }