Example #1
0
 public function update(CatalogRequest $request, $catalog_id)
 {
     $Catalog = Catalog::find($catalog_id);
     $Catalog->name = $request->get('name', $Catalog->name);
     $Catalog->price = $request->get('price', $Catalog->price);
     $Catalog->category = $request->get('category', $Catalog->category);
     $Catalog->save();
     return redirect()->route($this->view_dir . '.index')->with('success', 'Record updated.');
 }
Example #2
0
 /**
  * Show the form for creating a new resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function create($id)
 {
     $Catalog = Catalog::find($id);
     return view($this->view_dir . '.' . __FUNCTION__)->with(compact('Catalog', 'id'));
 }