Exemplo n.º 1
0
 /**
  * Create a new newsletter instance.
  *
  * @param  \Illuminate\Http\Request  $request
  * @return \Illuminate\Http\Response
  */
 public function store(Request $request)
 {
     $validate = ['email' => 'required'];
     $validator = Controller::validator($request, $validate);
     if ($validator !== true) {
         return Controller::response(Controller::error(38), 400);
     }
     $isValid = $this->isValid($request);
     if ($isValid !== true) {
         return Controller::response(Controller::error(21), 400);
     }
     $response = $this->newsletter->pushNewsletter($request);
     return Controller::response($response, 200);
 }