Laravel\Cashier\Billable::subscribedToPlan PHP Method

subscribedToPlan() public method

Determine if the user is actively subscribed to one of the given plans.
public subscribedToPlan ( array | string $plans, string $subscription = 'default' ) : boolean
$plans array | string
$subscription string
return boolean
    public function subscribedToPlan($plans, $subscription = 'default')
    {
        $subscription = $this->subscription($subscription);
        if (!$subscription || !$subscription->valid()) {
            return false;
        }
        foreach ((array) $plans as $plan) {
            if ($subscription->braintree_plan === $plan) {
                return true;
            }
        }
        return false;
    }