/** * Store a newly created resource in storage. * * @return Response */ public function postIndex(Request $request) { $usuario = new Usuario(); $inputs = $request->all(); $usuario->fill($inputs); if ($usuario->validate()) { $credentials = $request->only('email', 'password', 'first_name', 'last_name'); $errores = $this->registrarPorSentry($credentials); if (empty($errores)) { return redirect('login')->withInput([$credentials['email']])->with('mensaje', 'Se registró el usuario correctamente'); } else { return back()->withInput()->withErrors($errores); } } else { return back()->withInput()->withErrors($usuario->getErrors()); } }