Skip to content

3.x#84

Open
marijoo wants to merge 34 commits into
mainfrom
next
Open

3.x#84
marijoo wants to merge 34 commits into
mainfrom
next

Conversation

@marijoo
Copy link
Copy Markdown
Member

@marijoo marijoo commented Apr 22, 2026

This PR introduces a new major version (v3), which comes relatively soon after the v2 release. I’m aware that this timing isn’t ideal. The main reason for moving to v3 so quickly is that a few performance decisions in v2 turned out not to be going far enough.

The performance improvement is remarkable though: Querying the currently valid meta values ​​for a model takes a full 350 ms in the test environment with approximately 80k data records using version 2.x, while with version 3.x it only takes 3 ms, which is more than 100 times faster.

The following changes are included in this PR:

  • Refactored meta relationship logic to use SQL Window Functions and custom Eloquent builder/relation classes for latest/historic meta queries.
  • Introduced MetaBuilder and LatestMetaRelation for advanced meta querying with window functions.
  • Changed allMeta, meta, publishedMeta, plannedMeta, and historicMeta relationships to use the new relation logic.
  • BREAKING CHANGE: This package requires at least Laravel 11 from now on, support for L9 and L10 is discontinued
  • BREAKING CHANGE: Removed withoutCurrent, withoutHistory and joinLatest scopes in favor of current (or onlyCurrent) and history (or onlyHistory) scopes
  • BREAKING CHANGE: The onlyCurrent scope can no longer be used on any of the meta relations, but you can still use it on the Meta model directly, like Meta::onlyCurrent()

marijoo added 30 commits April 18, 2026 12:52
- Refactored meta relationship logic to use SQL Window Functions and custom Eloquent builder/relation classes for latest/historic meta queries.
- Introduced `MetaBuilder` and `LatestMetaRelation` for advanced meta querying with window functions.
- Changed `allMeta`, `meta`, `publishedMeta`, `plannedMeta`, and `historicMeta` relationships to use the new relation logic.

BREAKING CHANGE: Removed `withoutCurrent`, `withoutHistory` and `joinLatest` scopes in favor of `current` (or `onlyCurrent`) and `history` (or `onlyHistory`) scopes.

BREAKING CHANGE: The `onlyCurrent` scope can no longer be used on any of the `meta` relations, but you can still use it on the `Meta` model directly, like `Meta::onlyCurrent()`.
BREAKING CHANGE: Laravel 11+ is required now
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant