Skip to content

feat: add custom relationship handling for performance optimization#4

Merged
oguzhanbukcuoglu merged 4 commits intodevfrom
fix-eager-behavior
Mar 22, 2026
Merged

feat: add custom relationship handling for performance optimization#4
oguzhanbukcuoglu merged 4 commits intodevfrom
fix-eager-behavior

Conversation

@oguzhanbukcuoglu
Copy link
Copy Markdown
Collaborator

No description provided.

…ed snapshot handling

- Added SnapshotSyncedBelongsTo, SnapshotSyncedBelongsToMany, SnapshotSyncedHasMany, SnapshotSyncedHasOne, SnapshotSyncedHasManyThrough, SnapshotSyncedHasOneThrough, SnapshotSyncedMorphMany, SnapshotSyncedMorphOne, SnapshotSyncedMorphTo, SnapshotSyncedMorphToMany, and their factory for creating instances.
- These classes enable proxying through the snapshot's source model, improving the handling of relationships in snapshot contexts.
…ot model handling

- Introduced the ResolvesSnapshotSource trait to facilitate the resolution of source model IDs from snapshot models.
- Added methods for retrieving source IDs, ensuring snapshot relations are loaded, and mapping snapshot keys to source IDs, enhancing the functionality of snapshot-related operations.
…lationship handling

- Added a global scope to ensure 'snapshot' is eager loaded when source relationships are defined.
- Enhanced the relationship resolution logic to utilize SnapshotSyncedRelationFactory for better support of various relationship types.
- Updated the initialization process to include 'snapshotSource' in the eager loading and refined the attributes handling in the __get method for improved clarity and performance.
…security

- Added 'data' to the hidden attributes in the Snapshot model to prevent it from being exposed in JSON responses, enhancing data security and encapsulation.
@oguzhanbukcuoglu oguzhanbukcuoglu changed the base branch from main to dev March 22, 2026 14:45
@oguzhanbukcuoglu oguzhanbukcuoglu merged commit 93d0855 into dev Mar 22, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant