Cashier Stripe Version
16.0
Laravel Version
11.44
PHP Version
8.2
Database Driver & Version
MariaDB
Description
When a user has an old (and canceled) subscription of a particular type and a new one which is active, this method under ManagesSubscriptions will return the canceled subscription.
    /**
     * Get a subscription instance by $type.
     *
     * @param  string  $type
     * @return \Laravel\Cashier\Subscription|null
     */
    public function subscription(string $type = 'default'): ?Subscription
    {
        return $this->subscriptions->where('type', $type)->first();
    } 
I'm not sure whether this is the intended behaviour, but it is inconvenient at least.
Steps To Reproduce
- Subscribe to a product.
 
- Cancel the subscription today.
 
- Subscribe again to the same product.
 
- Call $user->susbcription($type).
 
- The old and canceled one is returned.