function edit($id) { if ($id) { $product = Product::find($id); $marketplaces = Marketplace::lists('name', 'id'); return view('admin.products.edit')->with(compact('product', 'marketplaces')); } }
public function destroy($id) { if ($id) { Marketplace::destroy($id); Session::flash('flash_message', 'Marketplace has been deleted successfully.'); Session::flash('flash_type', 'alert-success'); } return redirect('admin/marketplaces'); }