Ejemplo n.º 1
0
 public function voted()
 {
     if ($this->exist_validation->fails()) {
         return BaseController::httpError($this->exist_validation);
     } else {
         if ($this->vote_check->missingVote()) {
             return BaseController::httpNotFound();
         } else {
             return BaseController::httpOk();
         }
     }
 }
Ejemplo n.º 2
0
 public function destroy()
 {
     if ($this->delete_validation->fails()) {
         return BaseController::httpError($this->delete_validation);
     } else {
         if ($this->follow_check->missing()) {
             return BaseController::httpNotfound();
         } else {
             $this->follow_gestion->destroy();
             BaseController::httpOk();
         }
     }
 }
Ejemplo n.º 3
0
 /**
  * Update the specified resource in storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function update($id)
 {
     if ($this->update_validation->fails($id)) {
         return BaseController::httpError($this->update_validation);
     } else {
         if ($this->group_check->update($id)) {
             return BaseController::httpNotFound();
         } else {
             $this->group_gestion->update($id);
             return BaseController::httpOk();
         }
     }
 }
Ejemplo n.º 4
0
 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function destroy()
 {
     if ($this->delete_validation->fails()) {
         return BaseController::httpError($this->delete_validation);
     } elseif (!$this->friend_check->exist()) {
         return BaseController::httpNotFound();
     } else {
         $this->friend_gestion->destroy();
         return BaseController::httpOk();
     }
 }
Ejemplo n.º 5
0
 public function voteFeed()
 {
     if ($this->list_validation->fails()) {
         return BaseController::httpError($this->list_validation);
     } else {
         return BaseController::httpContent($this->post_gestion->voteFeed(), 'vote_feed');
     }
 }
Ejemplo n.º 6
0
 /**
  * Activate a specified user.
  *
  * @param  int  $id
  * @return Response
  */
 public function activate()
 {
     if ($this->activate_validation->fails()) {
         return BaseController::httpError($this->activate_validation);
     } else {
         if ($this->user_check->badToken()) {
             return BaseController::httpNotFound();
         } else {
             $this->user_gestion->activate();
             return BaseController::httpOk();
         }
     }
 }