public function tipdel(Request $request, $id) { Health_tips::where('hid', $id)->delete(); $tips = Health_tips::all(); $HTMLView = (string) view('costomize_home_views.home1')->with(['tipload' => $tips]); $res['page'] = $HTMLView; return response()->json($res); }
public function tipDelete(Request $request, $id) { try { //delete the heathtip from the table Health_tips::where('hid', $id)->delete(); //get all the health tips $tips = Health_tips::all(); $HTMLView = (string) view('costomize_home_views.home1')->with(['tipload' => $tips]); $res['page'] = $HTMLView; return response()->json($res); } catch (Exception $e) { $HTMLView = (string) view('errors.adminError'); $res['page'] = $HTMLView; return response()->json($res); } }