public function postManage($code = null)
    {
        if ($code === null) {
            throw new NotFoundHttpException();
        }

        $subscriber = Subscriber::where('verify_code', '=', $code)->first();

        if (!$subscriber) {
            throw new BadRequestHttpException();
        }

        try {
            execute(new UpdateSubscriberSubscriptionCommand($subscriber, Binput::get('subscriptions')));
        } catch (ValidationException $e) {
            return cachet_redirect('subscribe.manage', $subscriber->verify_code)
                ->withInput(Binput::all())
                ->withTitle(sprintf('%s %s', trans('dashboard.notifications.whoops'), trans('cachet.subscriber.email.failure')))
                ->withErrors($e->getMessageBag());
        }

        return cachet_redirect('subscribe.manage', $subscriber->verify_code)
            ->withSuccess(sprintf('%s %s', trans('dashboard.notifications.awesome'), trans('cachet.subscriber.email.updated-subscribe')));
    }
public function postManage($code = null)
    {
        if ($code === null) {
            throw new NotFoundHttpException();
        }

        $subscriber = Subscriber::where('verify_code', '=', $code)->first();

        if (!$subscriber) {
            throw new BadRequestHttpException();
        }

        try {
            execute(new UpdateSubscriberSubscriptionCommand($subscriber, Binput::get('subscriptions')));
        } catch (ValidationException $e) {
            return cachet_redirect('subscribe.manage', $subscriber->verify_code)
                ->withInput(Binput::all())
                ->withTitle(sprintf('%s %s', trans('dashboard.notifications.whoops'), trans('cachet.subscriber.email.failure')))
                ->withErrors($e->getMessageBag());
        }

        return cachet_redirect('subscribe.manage', $subscriber->verify_code)
            ->withSuccess(sprintf('%s %s', trans('dashboard.notifications.awesome'), trans('cachet.subscriber.email.updated-subscribe')));
    }
public function postManage ( $ code = null ) { if ( $ code === null ) { throw new NotFoundHttpException ( ) ; } $ subscriber = Subscriber :: where ( 'verify_code' , '=' , $ code ) -> first ( ) ; if ( ! $ subscriber ) { throw new BadRequestHttpException ( ) ; } try { execute ( new UpdateSubscriberSubscriptionCommand ( $ subscriber , Binput :: get ( 'subscriptions' ) ) ) ; } catch ( ValidationException $ e ) { return cachet_redirect ( 'subscribe.manage' , $ subscriber -> verify_code ) -> withInput ( Binput :: all ( ) ) -> withTitle ( sprintf ( '%s %s' , trans ( 'dashboard.notifications.whoops' ) , trans ( 'cachet.subscriber.email.failure' ) ) ) -> withErrors ( $ e -> getMessageBag ( ) ) ; } return cachet_redirect ( 'subscribe.manage' , $ subscriber -> verify_code ) -> withSuccess ( sprintf ( '%s %s' , trans ( 'dashboard.notifications.awesome' ) , trans ( 'cachet.subscriber.email.updated-subscribe' ) ) ) ; }
Updates the subscription manager for a subscriber.

@param string|null $code

@return \Illuminate\View\View
Updates the subscription manager for a subscriber .