Laravel\Cashier\Billable::updateSubscriptionsToPaymentMethod PHP Method

updateSubscriptionsToPaymentMethod() protected method

Update the payment method token for all of the user's subscriptions.
protected updateSubscriptionsToPaymentMethod ( string $token ) : void
$token string
return void
    protected function updateSubscriptionsToPaymentMethod($token)
    {
        foreach ($this->subscriptions as $subscription) {
            if ($subscription->active()) {
                BraintreeSubscription::update($subscription->braintree_id, ['paymentMethodToken' => $token]);
            }
        }
    }