ghanem/friendship
A Laravel package for managing friendships with an Eloquent-friendly API. Send, accept, or deny friend requests, unfriend, block users, and query friends, pending requests, and relationship status in your application.
Architecture fit
User — it can extend to Team, Page, or Organization without a schema change. That is the main architectural reason to prefer it over a hand-rolled friendships table.Integration feasibility
composer require, publish migrations/config, add the trait to one or two models, wrap the facade in a thin domain service. Realistic spike effort is 1–3 engineer-days including tests.Technical risk
opportunity: 7 sub-score is the counterweight: the domain problem is real and recurring, and the alternative is building and maintaining this state machine in-house.Key questions
composer.json, and is the test matrix actually run in CI across them?users tables cleanly?Stack fit
Migration path
sender_type, sender_id, status and recipient_type, recipient_id, status) before any production data exists.friends pivot), expect a one-way conversion and keep the legacy table read-only for one release as a rollback path.Compatibility
composer.json and treat upgrades as deliberate work, not composer update residue.Sequencing
FriendshipService interface so the package is replaceable and call sites never depend on it directly.Maintenance
Support
Scaling
morphWith/morphWithCount usage that the package will not do for you.Failure modes
morphMany cleanup, causing silent join misses and count drift.migrate:rollback before production.Ramp-up
How can I help you explore Laravel packages today?