public function doDelete($id) { $gift = Gift::findOrFail($id); try { $gift->delete(); return redirect()->back()->with('message', 'Gift has been deleted successfully !'); } catch (ParseException $ex) { echo 'Failed to create new meal , with error message: ' . $ex->getMessage(); } }
/** * Display the specified resource. * * @param int $id * @return \Illuminate\Http\Response */ public function show($id) { $gift = Gift::findOrFail($id); return view('gifts.show')->with('gift', $gift); }
/** * Remove the specified resource from storage. * * @param int $id * @return \Illuminate\Http\Response */ public function destroy($id) { $gift = Gift::findOrFail($id); $gift->delete(); return redirect()->route('admin.gifts.index')->with('message', 'Xóa thành công'); }