Ejemplo n.º 1
0
 /**
  * Store a newly created resource in storage.
  *
  * @return Response
  */
 public function store()
 {
     if ($this->create_validation->fails()) {
         return BaseController::httpError($this->create_validation);
     } elseif ($this->friend_check->missingUser()) {
         return BaseController::httpNotFound();
     } elseif ($this->friend_check->exist()) {
         return BaseController::httpExist();
     } else {
         $this->friend_gestion->store();
         return BaseController::httpOk();
     }
 }
Ejemplo n.º 2
0
 public function store()
 {
     //dd($this->follow_check->missing());
     if ($this->create_validation->fails()) {
         return BaseController::httpError($this->create_validation);
     } elseif ($this->follow_check->missingUser()) {
         return BaseController::httpNotfound();
     } elseif (!$this->follow_check->missing()) {
         return BaseController::httpExist();
     } else {
         $this->follow_gestion->store();
         return BaseController::httpOk();
     }
 }
Ejemplo n.º 3
0
 public function dislike()
 {
     if ($this->create_validation->fails()) {
         return BaseController::httpError($this->create_validation);
     } else {
         if ($this->vote_check->badVote()) {
             return BaseController::httpNotFound();
         } elseif (!$this->vote_check->missingVote()) {
             return BaseController::httpExist();
         } else {
             $this->vote_gestion->dislike();
             return BaseController::httpOk();
         }
     }
 }