original_string: public function postSignup($code = null)
      {
          if ($code === null) {
              throw new NotFoundHttpException();
          }
  
          $invite = Invite::where('code', '=', $code)->first();
  
          if (!$invite || $invite->is_claimed) {
              throw new BadRequestHttpException();
          }
  
          try {
              execute(new SignupUserCommand(
                  Binput::get('username'),
                  Binput::get('password'),
                  Binput::get('email'),
                  User::LEVEL_USER
              ));
          } catch (ValidationException $e) {
              return cachet_redirect('signup.invite', [$invite->code])
                  ->withInput(Binput::except('password'))
                  ->withTitle(sprintf('%s %s', trans('dashboard.notifications.whoops'), trans('cachet.signup.failure')))
                  ->withErrors($e->getMessageBag());
          }
  
          execute(new ClaimInviteCommand($invite));
  
          return cachet_redirect('status-page')
              ->withSuccess(sprintf('<strong>%s</strong> %s', trans('dashboard.notifications.awesome'), trans('cachet.signup.success')));
      }
code: public function postSignup($code = null)
      {
          if ($code === null) {
              throw new NotFoundHttpException();
          }
  
          $invite = Invite::where('code', '=', $code)->first();
  
          if (!$invite || $invite->is_claimed) {
              throw new BadRequestHttpException();
          }
  
          try {
              execute(new SignupUserCommand(
                  Binput::get('username'),
                  Binput::get('password'),
                  Binput::get('email'),
                  User::LEVEL_USER
              ));
          } catch (ValidationException $e) {
              return cachet_redirect('signup.invite', [$invite->code])
                  ->withInput(Binput::except('password'))
                  ->withTitle(sprintf('%s %s', trans('dashboard.notifications.whoops'), trans('cachet.signup.failure')))
                  ->withErrors($e->getMessageBag());
          }
  
          execute(new ClaimInviteCommand($invite));
  
          return cachet_redirect('status-page')
              ->withSuccess(sprintf('<strong>%s</strong> %s', trans('dashboard.notifications.awesome'), trans('cachet.signup.success')));
      }
code_tokens: public function postSignup ( $ code = null ) { if ( $ code === null ) { throw new NotFoundHttpException ( ) ; } $ invite = Invite :: where ( 'code' , '=' , $ code ) -> first ( ) ; if ( ! $ invite || $ invite -> is_claimed ) { throw new BadRequestHttpException ( ) ; } try { execute ( new SignupUserCommand ( Binput :: get ( 'username' ) , Binput :: get ( 'password' ) , Binput :: get ( 'email' ) , User :: LEVEL_USER ) ) ; } catch ( ValidationException $ e ) { return cachet_redirect ( 'signup.invite' , [ $ invite -> code ] ) -> withInput ( Binput :: except ( 'password' ) ) -> withTitle ( sprintf ( '%s %s' , trans ( 'dashboard.notifications.whoops' ) , trans ( 'cachet.signup.failure' ) ) ) -> withErrors ( $ e -> getMessageBag ( ) ) ; } execute ( new ClaimInviteCommand ( $ invite ) ) ; return cachet_redirect ( 'status-page' ) -> withSuccess ( sprintf ( '<strong>%s</strong> %s' , trans ( 'dashboard.notifications.awesome' ) , trans ( 'cachet.signup.success' ) ) ) ; }
docstring: Handle a signup request.
  
  @param string|null $code
  
  @return \Illuminate\View\View
docstring_tokens: Handle a signup request .