Skip to content

1.3.1

Latest

Choose a tag to compare

@masterix21 masterix21 released this 01 Aug 00:36
Immutable release. Only release title and notes can be modified.
f757bc9

Patch release: concurrency, event-timing and validation fixes across the entitlements core and the Filament plugin, a new unique index on plan item types, and Laravel Boost AI guidelines for host applications.

Fixed

  • Slot release race — SlotStrategy::requestRelease() now locks and re-checks the usages it is about to mark: a usage already released can no longer revert to Releasing and double-decrement slot_used. forceRelease() decrements by the usage amount instead of always 1.
  • Concurrent changePlan() — the anchor license is locked before reading pending transitions, so two concurrent calls can no longer leave two pending transitions on the same anchor.
  • Plan changes towards empty plans are rejected upfront (IncompatiblePlanTransition) instead of failing after commit with an inconsistent Failed transition.
  • Computed-type downgrades are validated against the registered resolver, so a downgrade below current computed usage is refused like any other type.
  • License::nextBillingAt() returns ends_at for non-recurring plans instead of projecting a billing period that will never recur.
  • entitlements.models.* overrides are honored across the Entitlements service and all strategies (previously some queries used the package models directly).
  • type_enum config validation reports actionable errors and label resolution tolerates enums whose getLabel() returns null.
  • Filament — Force Release Slot operates on releasing usages across the whole license group (anchor + children), not only the selected license.
  • Filament — plan deletion: single and bulk delete are blocked for plans still referenced by licenses or plan transitions.
  • Filament — plan form: the item-type repeater prevents selecting the same type twice (the database now enforces it too, see Changed).
  • Filament — change plan: the current plan stays visible (disabled) in the select, and TransitionAlreadyResolved is handled with a user-facing notification instead of a 500.
  • Dropped HasTranslations methods that delegated to non-existent parent methods.

Changed

  • Domain events dispatch after the surrounding transaction commits (DB::afterCommit). Listeners no longer observe uncommitted state and are not invoked at all when the transaction rolls back.
  • New migration adds a unique index on entitlement_plan_items (plan_id, type), enforcing one item per type per plan at the database level. Re-publish the migrations (vendor:publish --tag="entitlements-migrations") and run php artisan migrate.
  • Translations publish to lang/vendor/laravel-entitlements/ (the standard vendor path) instead of the app's root lang/ directory. Move any customized copies to the vendor subdirectory.

Dependencies

  • filament-badgeable-column is constrained to ^4.0: the previous wildcard let prefer-lowest builds resolve a Filament 3 release with an unregistered view namespace, breaking table rendering.

Documentation

  • Laravel Boost AI guidelines shipped at resources/boost/guidelines/laravel-entitlements/ — strategy semantics, plan/item invariants, transition validation rules, the post-commit event guarantee, exceptions, HTTP resources and common pitfalls for AI assistants in host apps.
  • README: plan_transition config keys, the four PlanTransition events, the complete exceptions reference, the vendor translations path and a Boost section.
  • The Entitlements facade docblock declares changePlan(), cancelTransition() and applyDueTransitions().

Tests

  • Suite grown from 126 to 135 tests (433 assertions), including regression tests for every fix above.

Full Changelog: 1.3.0...1.3.1