public function productdestroy($id) { $imagefromdata = DB::table('products')->where('id', $id)->value('imgurl'); $path = public_path("uploads\\" . $imagefromdata); unlink($path); Session::flash('flash_message', 'Xóa thành công!'); Session::flash('flash_type', 'alert-success'); Products::destroy($id); return \Redirect::route('products'); }
/** * Remove the specified resource from storage. * * @param int $id * @return Response */ public function destroy($id) { Products::destroy($id); return redirect('products'); }
public function destroyProduct($id) { Products::destroy($id); }