コード例 #1
0
ファイル: MenController.php プロジェクト: ronal2do/stq001_bkp
 /**
  * Store a newly created resource in storage.
  *
  * @param  Request  $request
  * @return Response
  */
 public function store(Request $request)
 {
     //dd($request->all());
     $dadosForm = $request->all();
     Mensagem::create($dadosForm);
     $this->disparaEmail($dadosForm['name']);
     return redirect("contato");
 }
コード例 #2
0
 /**
  * Store a newly created resource in storage.
  *
  * @param  Request  $request
  * @return Response
  */
 public function store(Request $request)
 {
     $mensagem = $request->json()->all();
     if (\App\Mensagem::create($mensagem)) {
         abort(201, "SMS criado");
     } else {
         abort(500, "Erro interno");
     }
 }
コード例 #3
0
ファイル: MenController.php プロジェクト: ronal2do/stq001
 /**
  * Store a newly created resource in storage.
  *
  * @param  Request  $request
  * @return Response
  */
 public function store(Request $request)
 {
     //dd($request->all());
     $validator = Validator::make($request->all(), ['nome' => 'required|min:3', 'email' => 'email', 'telefone' => 'numeric']);
     if ($validator->fails()) {
         return redirect()->back()->withErrors($validator)->withInput();
     }
     $dadosForm = $request->all();
     Mensagem::create($dadosForm);
     return redirect()->back();
 }