/**
  * Show the form for editing the specified resource.
  *
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function edit($id)
 {
     $product = Product::findOrFail($id);
     $tags = Dict::byname('productTags')->items->lists('name', 'value');
     return view('admin.product.edit', compact('product', 'tags'));
 }
 /**
  * Store a newly created resource in storage.
  *
  * @param  \Illuminate\Http\Request  $request
  * @return \Illuminate\Http\Response
  */
 public function store(Request $request)
 {
     $dict = Dict::findOrFail($request->get('dictId'));
     return $dict->items()->create($request->all());
 }
 private function getTags()
 {
     $dict = Dict::byName('articleTag');
     return $dict->items->lists('name', 'value');
 }
Ejemplo n.º 4
0
 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function destroy($id)
 {
     Dict::destroy($id);
 }
 private function getTags()
 {
     return Dict::byName('bannerTag')->items->lists('name', 'value');
 }