/** * Display a listing of the resource. * * @return Response */ public function index() { return view('admin.goods_types.index')->withTypes(GoodsType::all()); }
/** * Show the form for editing the specified resource. * * @param int $id * @return Response */ public function edit($id) { $attr = Attribute::find($id); $attr->attr_value = implode(PHP_EOL, unserialize($attr->attr_value)); return view('admin.attrs.edit')->withAttr($attr)->with('types', GoodsType::all()); }
/** * Show the form for editing the specified resource. * * @param int $id * @return Response */ public function edit($id) { $goods = Goods::find($id); //栏目下拉框 $cats = Category::getSelectCats(); $types = GoodsType::all(); //获取所有types $photos = $goods->photos; //to-do return view('admin.goods.edit')->with('goods', $goods)->with('types', $types)->with('cats', $cats)->with('photos', $photos); }