stillat/relationships
A Laravel package that streamlines working with model relationships through a fluent, expressive API. It helps define and manage related records, reduce boilerplate, and keep Eloquent models clean and organized.
Stillat Relationships is an Eloquent relationship helper; reach for it when you need higher-level relationship operations such as reconciling a one-to-many collection without hand-written diff logic. Install with Composer (composer require stillat/relationships) and confirm the service provider is auto-discovered; if the README requires publishing config or adding a trait to models, do that before using sync helpers. Look first at the one-to-many sync documentation and tests, because v2.4.0 specifically fixes one-to-many syncing. A good first use case is a Team hasMany Members or Post hasMany Comments list where the UI submits the desired child IDs: wrap the package sync in a transaction, refresh the relation, and assert foreign keys in a feature test. Upgrade to ^2.4 if one-to-many sync is part of your workflow.
sync unless the package wrapper gives you needed consistency.RefreshDatabase: no-op sync, add, remove, and mixed changes. Assert child foreign keys, absence of detached rows, and relation counts using factories and assertDatabaseHas.>=2.4.0 and re-test any custom workaround you built for the old behavior.php artisan config:clear after changes. Debug with toSql, DB::listen, assertDatabaseHas, and withoutGlobalScopes to reveal hidden rows.^2.4; prefer extending via your own action classes around package calls rather than editing vendor code.How can I help you explore Laravel packages today?