public function edit($id) { $obj = Material::with(array('vendorProfile', 'productType'))->where('id', $id)->first(); // return $obj; $vendors = VendorProfile::where('is_verified', 1)->get(); $elements = Element::with('Types')->get(); return View::make('partials.product.edit')->with('product', $obj)->with('vendors', $vendors)->with('elements', $elements); }
public function postDelete() { $id = Input::get('id'); $vendor = VendorProfile::find($id); if (is_object($vendor)) { $vendor->delete(); } return Redirect::back(); }