/**
  * Store a newly created resource in storage.
  *
  * @return 
  */
 public function store(FormularioRequest $request)
 {
     $input = $request->all();
     $formulario = Formulario::create($input);
     $this->enviarEmail($formulario);
     return redirect('appontment_success');
 }
 public function registro($code)
 {
     $datos = Formulario::where('token', $code)->first();
     if (!$datos) {
         abort(404);
     } else {
         return view('registro', ['registro' => $datos]);
     }
 }
 /**
  * Store a newly created resource in storage.
  *
  * @param  \Illuminate\Http\Request  $request
  * @return \Illuminate\Http\Response
  */
 public function store(Request $request)
 {
     $form = new Formulario();
     $pregunta6 = "";
     $form->preg1 = $request->preg1;
     $form->preg2 = $request->preg2;
     $form->preg3 = $request->preg3;
     $form->preg4 = $request->preg4;
     $form->preg5 = $request->preg5;
     if ($request->preg6) {
         foreach ($request->preg6 as $value) {
             $pregunta6 = $pregunta6 . "," . $value;
         }
     }
     $form->preg6 = $pregunta6;
     $form->preg7 = $request->preg7;
     $form->preg8 = $request->preg8;
     $form->preg9 = $request->preg9;
     $form->preg10 = $request->preg10;
     $form->save();
     return redirect('/');
 }