public function cancel($immediately = false)
    {
        $this->canceled_at = Carbon::now();

        if ($immediately) {
            $this->canceled_immediately = true;
        }

        if ($this->save()) {
            event(new SubscriptionCanceled($this));

            return $this;
        }

        return false;
    }
public function cancel($immediately = false)
    {
        $this->canceled_at = Carbon::now();

        if ($immediately) {
            $this->canceled_immediately = true;
        }

        if ($this->save()) {
            event(new SubscriptionCanceled($this));

            return $this;
        }

        return false;
    }
public function cancel ( $ immediately = false ) { $ this -> canceled_at = Carbon :: now ( ) ; if ( $ immediately ) { $ this -> canceled_immediately = true ; } if ( $ this -> save ( ) ) { event ( new SubscriptionCanceled ( $ this ) ) ; return $ this ; } return false ; }
Cancel subscription.

@param  bool $immediately
@return $this
Cancel subscription .