Skip to content

v3.0.0-beta1

Pre-release
Pre-release

Choose a tag to compare

@cjmellor cjmellor released this 25 May 15:07
· 55 commits to 3.x since this release
Immutable release. Only release title and notes can be modified.
v3.0.0-beta1
b05ff5c

First public beta of level-up v3. Three breaking changes, four behavioural fixes, one migration stub repair, and a full upgrade guide.

Important

This is a pre-release. To install:

composer require cjmellor/level-up:^3.0@beta

Or set "minimum-stability": "beta" in composer.json.

Upgrade from v2.x

See UPGRADE.md for the full v2.x → v3.0 section with Likelihood-of-Impact ratings, or use the new level-up-upgrade-v3 Boost skill for a step-by-step walkthrough.

Breaking changes

  • Multiplier::scopeTo(Model ...$models) removed — replaced with typed scopeToUser / scopeToTier plus unscopeFromUser / unscopeFromTier / isGlobal.
  • multiplier_scopes polymorphic table replaced with two typed pivots (multiplier_user, multiplier_tier). Auto-backfill migration ships in v3. Removes the MorphToManyWithTextCast Postgres workaround from v2.1.
  • 'level-up.table' legacy config key removed (deprecated since v2.0).
  • UserForeignKey helper class removed — replaced by $table->userForeignId() macro.
  • Trait method aliasing helpers removed — host User models with colliding trait methods need to rename or compose into a wrapper model.
  • setPoints() recalculates level and tier — fires UserLevelledUp / UserTierUpdated events when the new total implies a different placement.
  • Excess points cap at the top level instead of throwing.

Fixed

  • addPoints / deductPoints / setPoints are now atomic — wrapped in DB::transaction, with events implementing ShouldDispatchAfterCommit.
  • grantAchievement / incrementAchievementProgress / revokeAchievement clear the cached achievements (and sibling) relations on the same instance.
  • addPoints first-time-experience branch resolves starting level via orderByDesc('level') to match PointsIncreasedListener.
  • alter_experience_audits_type_to_string migration down() now works on PostgreSQL.

Removed

  • Multiplier::scopeTo, Multiplier::scopes relation.
  • src/Models/MultiplierScope.php, src/Support/UserForeignKey.php.
  • database/migrations/create_multiplier_scopes_table.php.stub.
  • config('level-up.table'), config('level-up.models.multiplier_scope'), config('level-up.tables.multiplier_scopes').

Full changelog: v2.1.0...v3.0.0-beta1