public function getRecuperaColor($id) { $dataModule["material_color_r"] = MaterialColor::select('material.id as material_id', 'material.nombre as material', 'color.id as color_id', 'color.nombre as color', 'material_color.id as material_color_id', 'material_color.activo')->leftjoin('color', 'material_color.color_id', '=', 'color.id')->leftjoin('material', 'material_color.material_id', '=', 'material_id')->where('material_color.id', $id)->firstorfail(); $dataModule["colores"] = Color::all(); $dataModule["materiales"] = Material::all(); return View::make($this->department . ".main", $this->data)->nest('child', 'recubrimientos.color_edit', $dataModule); }
/** * Show the form for editing the specified resource. * * @param int $id * @return Response */ public function edit($id) { $product = Product::find($id); $departments = Department::all()->lists('name', 'id'); $categories = Category::all()->lists('name', 'id'); $brands = Brand::all()->lists('name', 'id'); $sizes = Size::all()->lists('name', 'id'); $colors = Color::all()->lists('name', 'id'); return View::make('admin::products.edit', compact('product', 'departments', 'categories', 'brands', 'sizes', 'colors')); }
public function getAll() { $obj = new Color($this->db); echo json_encode($obj->all()); }