Skip to content

Conversation

@cb-srinaths
Copy link
Contributor

@cb-srinaths cb-srinaths commented Oct 29, 2025

Note

Refactors entitlement enums to use FeatureEnumContract (extending BackedEnum), switches config to env-driven options, fixes entitlement cache serialization, adds hard failure for missing features, and returns Collections for entitlement queries.

  • Entitlements API:
    • Switch method signatures from FeatureEnumContract&BackedEnum to FeatureEnumContract across Route::requiresEntitlement, HasEntitlements::hasAccess, Entitlement::providesFeature, middleware, and RequiresEntitlement attribute.
    • Make FeatureEnumContract extend BackedEnum.
  • Configuration (config/cashier.php):
    • Read entitlements.enabled, entitlements.access_verifier, and entitlements.feature_defaults from env vars (CASHIER_ENTITLEMENTS_*).
  • Caching & Error handling:
    • Store entitlements cache as array (->toArray()); convert back via Entitlement::fromArray when loading.
    • On missing feature(s) in DB during access check: log error and throw HttpException(500).
  • Subscriptions:
    • Subscription::getEntitlements() now returns Collection<Entitlement> and builds via collections.
  • Docs:
    • Update to reflect enum contract change and configuration adjustments.

Written by Cursor Bugbot for commit 9eea445. This will update automatically on new commits. Configure here.

cursor[bot]

This comment was marked as outdated.

@cb-alish cb-alish merged commit 8c852e9 into main Feb 11, 2026
@cb-alish cb-alish deleted the fix/1.3.0-beta.2 branch February 11, 2026 09:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants