public function logout() { $deviceDetail = new DeviceDetails(); $data = Input::all(); $delete = $deviceDetail->deleteDetail($data['user_id'], $data['token']); if ($delete == 0) { $msg[] = "New User"; return $this->successMessage($msg); } else { $msg[] = "Logout Successfully."; return $this->successMessage($msg); } }
/** * Update the specified resource in storage. * * @param Request $request * @param int $id * @return Response */ public function update($id) { $notification = new Notification(); $deviceDetail = new DeviceDetails(); $data = Input::all(); $reciverToken = $deviceDetail->getLatestDetailByUserId($data['reciver_id']); $sendNotification = $notification->sendConfNotification($data, $reciverToken, $id); $msg = "Your location is send successfully."; return $this->successMessageWithVar($msg, $sendNotification); }
public function getFullDetail($id, $lat, $lng) { $user = new User(); $deviceDetail = new DeviceDetails(); $data = Input::all(); $fbID = $user->getFbIdAttachedWithUserId($id); $totalData = count($data); $fbIdArray = array(); for ($i = 0; $i < $totalData; $i++) { $userWithoutBlock = $user->checkBlockList($fbID, $data[$i]); if (!empty($userWithoutBlock)) { array_push($fbIdArray, $data[$i]); } } $nonBlock = array_diff($data, $fbIdArray); $changeArray = implode(", ", $nonBlock); $userDetail = $user->getFullDetails($lat, $lng, '100', $changeArray); $latLngArray = array('lat' => $lat, 'lng' => $lng); $deviceDetail->updateDeviceDetails($latLngArray, 'user_id', $id); $msg = "Fetched successfully."; return $this->successMessageWithVar($msg, $userDetail); }