v2.0.0
Here's the cleaned-up version:
Breaking Changes
- Relation configuration now uses DTO classes instead of arrays
- Old format
['belongsTo', 'repo', 'fk', 'setter']no longer supported
- Old format
- Operator syntax changed from positional to associative arrays
- Old:
['!=', 'value']→ New:['!=' => 'value']
- Old:
- Removed
useAutoIncrementproperty (custom IDs now auto-detected)
New Features
BelongsToManyrelation for many-to-many via pivot tables- Relation DTO classes:
BelongsTo,HasOne,HasMany,BelongsToMany - Automatic custom ID detection in
create() - Support for custom/UUID primary keys in all relation types
Improvements
- Unambiguous operator syntax — no conflicts between
['!=', 'val']and IN-lists['a', 'b'] - Lazy initialization of EagerLoadingService
Migration
Relations:
// Before
'user' => ['belongsTo', 'userRepository', 'user_id', 'setUser']
// After
'user' => new BelongsTo(
repository: 'userRepository',
foreignKey: 'user_id',
setter: 'setUser',
)Operators:
// Before
['status' => ['!=', 'deleted'], 'age' => ['>=', 18]]
// After
['status' => ['!=' => 'deleted'], 'age' => ['>=' => 18]]Custom IDs:
// Before
protected bool $useAutoIncrement = false; // Remove this
// After — auto-detected:
$repo->create(['uuid' => 'custom-123', ...]); // Uses provided ID
$repo->create(['name' => 'Test']); // Uses lastInsertId()