v0.3.3
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.