public function edit($id) { $brands = array_add($this->brandRepo->lists(), '', 'Seleccione'); $types = array_add($this->productTypeTepo->lists(), '', 'Seleccione'); $presentations = array_add($this->presentationRepo->lists(), '', 'Seleccione'); $product = $this->productRepo->findOrFail($id); return view('products/edit', compact('product', 'brands', 'presentations', 'types')); }
public function download(Request $request) { $types = $this->productTypeTepo->search($request)->get(); Excel::create('Tipos_De_Productos', function ($excel) use($types) { $excel->sheet('Listado', function ($sheet) use($types) { $sheet->loadView('types.partials.table', compact('types')); }); })->export('xls'); }