Skip to main content

Multiple Subscriptions

When a billable has subscriptions in multiple slots (for example, a default plan and a team add-on), you can check entitlements scoped to a specific slot or aggregate them across all active subscriptions.

Checking a specific slot

use Pixelworxio\Subscribd\Facades\Entitlements;

// Check entitlements from the 'team' subscription only
Entitlements::for($user)->on('team')->allows('team_features');
Entitlements::for($user)->on('team')->limit('seats');

Checking any slot

allows() without a slot name checks the user’s default subscription:
Entitlements::for($user)->allows('exports');
To check whether the feature is allowed in any active subscription:
Entitlements::for($user)->acrossAll()->allows('exports');
// Returns true if any active subscription grants 'exports'

Summing limits across slots

When a numeric limit should be aggregated (e.g., seats from both a personal plan and a team plan), sum across all active subscriptions:
$totalSeats = Entitlements::for($user)->acrossAll()->limit('seats');
// Returns the sum of 'seats' from all active subscriptions
// e.g. personal plan gives 5, team plan gives 100 → returns 105

Plan configuration for multiple slots

See Multiple Subscription Slots for how to create subscriptions in named slots. Entitlement slot names match the name option passed to CreateSubscription:
use Pixelworxio\Subscribd\Actions\CreateSubscription;
use Pixelworxio\Subscribd\Models\Plan;

$personalPlan = Plan::query()->where('key', 'pro')->firstOrFail();
$teamPlan     = Plan::query()->where('key', 'team-add-on')->firstOrFail();

app(CreateSubscription::class)->execute($user, $personalPlan, ['name' => 'default']);
app(CreateSubscription::class)->execute($user, $teamPlan,     ['name' => 'team']);

Next steps