stancl/laravel-hasmanywithinverse
Laravel's hasMany leaves the inverse relation unset, so accessing the parent from each child triggers extra queries. This package adds hasManyWithinverse, which hydrates the inverse automatically—so $child->parent is already loaded without N+1.
hasMany relationships. Low architectural footprint; best suited to Laravel service/domain layers where bidirectional model consistency reduces custom relationship code.archtechx/laravel-hasmanywithinverse to v1.4.1 and do not upgrade to v1.4.2 until Laravel is upgraded. For Laravel 9/10: update the package, run the full test suite, and verify inverse assignment, eager loading, and serialization behavior. If the package is not already used, require a clear use case before adoption.composer.json constraints for Laravel and PHP. Add CI coverage across supported Laravel versions. Treat v1.4.2 as breaking for Laravel 8 consumers despite the minor version number.How can I help you explore Laravel packages today?