original_string: public function getUnsubscribe($code = null, $subscription = null)
      {
          if ($code === null) {
              throw new NotFoundHttpException();
          }
  
          $subscriber = Subscriber::where('verify_code', '=', $code)->first();
  
          if (!$subscriber || !$subscriber->is_verified) {
              throw new BadRequestHttpException();
          }
  
          if ($subscription) {
              execute(new UnsubscribeSubscriptionCommand(Subscription::forSubscriber($subscriber->id)->firstOrFail()));
          } else {
              execute(new UnsubscribeSubscriberCommand($subscriber));
          }
  
          return cachet_redirect('status-page')
              ->withSuccess(sprintf('%s %s', trans('dashboard.notifications.awesome'), trans('cachet.subscriber.email.unsubscribed')));
      }
code: public function getUnsubscribe($code = null, $subscription = null)
      {
          if ($code === null) {
              throw new NotFoundHttpException();
          }
  
          $subscriber = Subscriber::where('verify_code', '=', $code)->first();
  
          if (!$subscriber || !$subscriber->is_verified) {
              throw new BadRequestHttpException();
          }
  
          if ($subscription) {
              execute(new UnsubscribeSubscriptionCommand(Subscription::forSubscriber($subscriber->id)->firstOrFail()));
          } else {
              execute(new UnsubscribeSubscriberCommand($subscriber));
          }
  
          return cachet_redirect('status-page')
              ->withSuccess(sprintf('%s %s', trans('dashboard.notifications.awesome'), trans('cachet.subscriber.email.unsubscribed')));
      }
code_tokens: public function getUnsubscribe ( $ code = null , $ subscription = null ) { if ( $ code === null ) { throw new NotFoundHttpException ( ) ; } $ subscriber = Subscriber :: where ( 'verify_code' , '=' , $ code ) -> first ( ) ; if ( ! $ subscriber || ! $ subscriber -> is_verified ) { throw new BadRequestHttpException ( ) ; } if ( $ subscription ) { execute ( new UnsubscribeSubscriptionCommand ( Subscription :: forSubscriber ( $ subscriber -> id ) -> firstOrFail ( ) ) ) ; } else { execute ( new UnsubscribeSubscriberCommand ( $ subscriber ) ) ; } return cachet_redirect ( 'status-page' ) -> withSuccess ( sprintf ( '%s %s' , trans ( 'dashboard.notifications.awesome' ) , trans ( 'cachet.subscriber.email.unsubscribed' ) ) ) ; }
docstring: Handle the unsubscribe.
  
  @param string|null $code
  @param int|null    $subscription
  
  @return \Illuminate\View\View
docstring_tokens: Handle the unsubscribe .