Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message
Relation Bundle

Relation Bundle Laravel Package

sly/relation-bundle

A lightweight PHP package for defining and managing relationships between models. It simplifies linking records, querying related data, and keeping relation logic reusable, with a clean API that fits naturally into existing Eloquent workflows.

View on GitHub
Deep Wiki
Context7

Symfony2 bundle to manage relations between models/entities (like friends, contacts and others).

Frequently asked questions about Relation Bundle
Is sly/relation-bundle compatible with Laravel 10 or 11?
No. The repository is a Symfony 2 bundle built on Doctrine ORM, not a Laravel package, and it does not bootstrap inside a Laravel application without pulling in Symfony framework and Doctrine bridge dependencies. Symfony 2.8 reached end of life in November 2018, so there is no Laravel 10 or 11 support. Treat it as reference material rather than a Composer dependency.
How do I install sly/relation-bundle with Composer?
You should not install it into a Laravel application. The package targets Symfony 2 and PHP 5.x, and adding it would bring a second framework and persistence layer into your app. If you need the relation schema, read the entity definitions and reimplement the pivot table in Eloquent instead.
Can I use sly/relation-bundle to group Eloquent relationships?
No, the artifact does not contain Eloquent integration. Its relation logic lives in Doctrine entities and Symfony services, so it cannot group Eloquent with() chains or model relationships. Laravel developers should use native Eloquent features such as morphToMany, morphMany, and scoped query methods to reuse eager-loading logic.
Is sly/relation-bundle actively maintained?
No. The package description explicitly states abandonment, and the codebase is tied to Symfony 2.8, which has been EOL since 2018. It has zero dependents, around 10 stars, and no PHP 8 or security patches. There is no community or downstream fork keeping it alive.
What is sly/relation-bundle used for?
Conceptually, it models typed relations between entities—friends, contacts, follows, or memberships—with a relation table that tracks source, target, relation type, direction, and status. In practice, it is a Symfony 2 bundle, so the useful output is the schema and invariants, not runnable Laravel code. The relation semantics can be reproduced with a polymorphic pivot in Eloquent.
Does sly/relation-bundle work with PHP 8?
No. The package lineage is PHP 5.x and Symfony 2, and no PHP 8 compatibility work has been done. Running it on modern PHP would require a port that starts from an abandoned codebase with no trusted test baseline. A clean Eloquent rewrite is cheaper and safer.
Should I use sly/relation-bundle in production?
No. A technical review flags framework mismatch, abandonment, EOL dependencies, and no production validation as dispositive risks. You would be the only operator of this code in the wild, with no security patching. Use it only as a one-to-two day reference read, not a production dependency.
How does sly/relation-bundle compare to native Eloquent eager loading?
Native Eloquent already supports eager loading with with(), constrained eager loads, and polymorphic relations for typed links. sly/relation-bundle does not plug into that system because it is a Doctrine/Symfony bundle. For reusable eager-loading groups, define scopes or helper methods on your models rather than adding a second ORM.
What are alternatives to sly/relation-bundle for Laravel?
Use Eloquent's morphToMany and morphMany with pivot columns for relation type, status, and direction. If you need deep relationship traversal, maintained packages like staudenmeir/eloquent-has-many-deep can help. For bundling repeated with() chains, add local scopes or a small first-party helper in your application.
What should I extract from sly/relation-bundle before discarding it?
Extract the relation table shape—source type and ID, target type and ID, relation type, symmetric versus directional flag, status or acceptance state, and timestamps—plus the bidirectional-consistency rules and traversal query patterns. Then implement a single polymorphic pivot in Eloquent with a composite unique index and reverse-lookup indexes. That gives you the useful prior art without the Symfony/Doctrine baggage.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
microsoft/fluentui-system-icons
mmccook/php-json-canonicalization-scheme
middlewares/firewall
qubiqx/montapacking
nyoncode/laravel-package-console
pnscripts/filament-broadquill-lite
pnscripts/laravel-sentfold-lite
vleap/mx-sdk-laravel-internal
twidpay/utils
htetmyathlaing/scout-elasticsearch-driver
artisan-toolbox/front-awesome
ls/client-assistant
users-au/laravel-client
cgv/localized-resource
noith/settings
kda/laravel-package
kda/filament-dynamic-navigation
bypersoft/signbox
pairus/product-data
fayne/laravel-filament-cms-core