Skip to content

v0.3.3

Choose a tag to compare

@wrsouza wrsouza released this 09 Jun 03:46
· 11 commits to main since this release

Added

BelongsToMany.withoutPivot() — hides the pivot object during JSON serialization without removing it from the runtime.

categories(): BelongsToMany<Category> {
  return this.belongsToMany(Category, 'category_post', 'post_id', 'category_id')
             .withoutPivot();
}

Fixed

toArray() now respects toJSON() on non-Model relationship values — objects like PivotRecord stored in _relations will have their toJSON() called during serialization; if it returns undefined, the key is omitted from the output.