relationshipRepository = $relationshipRepository; } /** * @return json */ public function getRelationships() { $response = []; try{ $response = $this->relationshipRepository->getRelationships(); $this->setStatusCode($response['status']); } catch (\Exception $ex) { $response['message'] = $ex->getMessage(); $response['success'] = Constant::STATUS_FALSE; $this->setStatusCode(Constant::CODE_403); } return $this->respond($response); } /** * @return json */ public function sendRelationshipRequest(Request $request) { $response = []; try{ $response = $this->relationshipRepository->sendRelationshipRequest($request->all()); $this->setStatusCode($response['status']); } catch (\Exception $ex) { $response['message'] = $ex->getMessage(); $response['success'] = Constant::STATUS_FALSE; $this->setStatusCode(Constant::CODE_403); } return $this->respond($response); } /** * @return json */ public function acceptRelationshipRequest(Request $request) { $response = []; try{ $response = $this->relationshipRepository->acceptRelationshipRequest($request->all()); $this->setStatusCode($response['status']); } catch (\Exception $ex) { $response['message'] = $ex->getMessage(); $response['success'] = Constant::STATUS_FALSE; $this->setStatusCode(Constant::CODE_403); } return $this->respond($response); } /** * @return json */ public function listRelationshipRequest() { $response = []; try{ $response = $this->relationshipRepository->listRelationshipRequest(); $this->setStatusCode($response['status']); } catch (\Exception $ex) { $response['message'] = $ex->getMessage(); $response['success'] = Constant::STATUS_FALSE; $this->setStatusCode(Constant::CODE_403); } return $this->respond($response); } /** * @return json */ public function sentRelationshipRequestList() { $response = []; try{ $response = $this->relationshipRepository->sentRelationshipRequestList(); $this->setStatusCode($response['status']); } catch (\Exception $ex) { $response['message'] = $ex->getMessage(); $response['success'] = Constant::STATUS_FALSE; $this->setStatusCode(Constant::CODE_403); } return $this->respond($response); } /** * @return json */ public function updateRelationshipRequest($id, Request $request) { $response = []; try{ $response = $this->relationshipRepository->updateRelationshipRequest($id, $request->all()); $this->setStatusCode($response['status']); } catch (\Exception $ex) { $response['message'] = $ex->getMessage(); $response['success'] = Constant::STATUS_FALSE; $this->setStatusCode(Constant::CODE_403); } return $this->respond($response); } /** * @return json */ public function userList(Request $request) { $response = []; try{ $response = $this->relationshipRepository->userList($request->all()); $this->setStatusCode($response['status']); } catch (\Exception $ex) { $response['message'] = $ex->getMessage(); $response['success'] = Constant::STATUS_FALSE; $this->setStatusCode(Constant::CODE_403); } return $this->respond($response); } }