Laravel\Cashier\Subscription::moneyRemainingOnYearlyPlan PHP Method

moneyRemainingOnYearlyPlan() protected method

Calculate the amount of discount to apply to a swap to monthly billing.
protected moneyRemainingOnYearlyPlan ( BraintreePlan $plan ) : float
$plan BraintreePlan
return float
    protected function moneyRemainingOnYearlyPlan($plan)
    {
        return $plan->price / 365 * Carbon::today()->diffInDays(Carbon::instance($this->asBraintreeSubscription()->billingPeriodEndDate), false);
    }