public function tipA(Request $request, $des1, $des2, $tip, $hid) { $user = Health_tips::whereHid($hid)->first(); $user->tip = $tip; $user->discription_1 = $des1; $user->discription_2 = $des2; $user->save(); $tips = Health_tips::all(); $HTMLView = (string) view('costomize_home_views.home1')->with(['tipload' => $tips]); $res['page'] = $HTMLView; return response()->json($res); }
public function get_health_tips() { try { $health_tip_main = Health_tips::orderBy('hid', 'DESC')->get(); } catch (Exception $e) { $this->LogError('Get Health Tips Function', $e); } return $health_tip_main; }
public function tipUpdate(Request $request, $des1, $des2, $tip, $hid) { try { //Get the health tip according to its id $user = Health_tips::whereHid($hid)->first(); $user->tip = $tip; //change tip $user->discription_1 = $des1; //change description 1 $user->discription_2 = $des2; //change description 2 $user->save(); //Get all health tips $tips = Health_tips::all(); //send result to the home1 page $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); } }