Open-Awesome
CategoriesAlternativesStacksSelf-HostedExplore
Open-Awesome

© 2026 Open-Awesome. Curated for the developer elite.

TermsPrivacyAboutGitHubRSS
  1. Home
  2. Laravel
  3. Friendship

Friendship

MITPHPv1.0.24

A Laravel package that adds friendship management capabilities to Eloquent models, enabling social features like friend requests and groups.

GitHubGitHub
700 stars145 forks0 contributors

What is Friendship?

Laravel Friendships is a PHP package for Laravel that adds friendship management functionality to Eloquent models. It allows developers to implement social features like friend requests, blocking, and friend grouping in their applications with minimal setup. The package solves the need for a standardized, reusable way to handle user relationships in Laravel-based social platforms.

Target Audience

Laravel developers building applications that require user-to-user relationships, such as social networks, community platforms, or any app with friend/connection features.

Value Proposition

Developers choose Laravel Friendships because it provides a ready-made, well-tested solution with an expressive API that aligns with Laravel's conventions, saving time compared to building custom friendship logic from scratch. Its trait-based design keeps models clean and integrates seamlessly with existing Laravel projects.

Overview

This package gives Eloquent models the ability to manage their friendships.

Use Cases

Best For

  • Adding friend systems to Laravel-based social networks
  • Implementing user blocking and unblocking features in community apps
  • Organizing user connections into groups like 'close friends' or 'family'
  • Building mutual friend discovery features
  • Handling friend request workflows (send, accept, deny)
  • Managing user relationships in Laravel SaaS platforms

Not Ideal For

  • Projects not using Laravel or those with non-Eloquent ORM systems
  • Applications needing real-time social features without additional event handling setup
  • Systems requiring asymmetric relationships like following or subscribing instead of mutual friendships
  • Teams seeking pre-built UI components for friend lists or request interfaces

Pros & Cons

Pros

Expressive Laravel API

Methods like `$user->befriend($recipient)` and `$user->acceptFriendRequest($sender)` align with Laravel's fluent syntax, making integration intuitive for developers familiar with the framework.

Event-Driven Flexibility

Fires events such as 'friendships.accepted' and 'friendships.blocked' for key actions, enabling easy hooks for notifications or logging without modifying core package logic.

Configurable Friend Groups

Allows customization of groups via config/friendships.php (e.g., 'close_friends', 'family') with methods like `groupFriend()` for organized relationship management.

Comprehensive Query Methods

Provides paginated queries for friends, pending requests, mutual friends, and more, as shown with `getFriends($perPage)` and `getMutualFriends($otherUser, $perPage)` in the README.

Cons

Manual Setup for Older Laravel

For Laravel versions below 5.5, users must manually add the service provider to config/app.php, adding complexity compared to auto-discovery in modern Laravel.

Limited Social Feature Scope

Focuses only on friendships; lacks built-in support for other common social interactions like messaging, reactions, or asymmetric follows, requiring additional packages or custom code.

Sparse Documentation for Edge Cases

The README points to test files for usage examples, suggesting official documentation may be minimal for advanced scenarios like performance optimization or custom event handling.

Frequently Asked Questions

Quick Stats

Stars700
Forks145
Contributors0
Open Issues28
Last commit4 years ago
CreatedSince 2015

Tags

#eloquent#user-management#laravel#php-package#social-features

Built With

P
PHP
L
Laravel
E
Eloquent

Included in

Laravel13.0k
Auto-fetched 17 hours ago

Related Projects

LiveWireLiveWire

A full-stack framework for Laravel that takes the pain out of building dynamic UIs.

Stars23,556
Forks1,742
Last commit2 days ago
Debug BarDebug Bar

Debugbar for Laravel (Integrates PHP Debug Bar)

Stars19,270
Forks1,617
Last commit14 days ago
IDE HelperIDE Helper

IDE Helper for Laravel

Stars14,953
Forks1,191
Last commit14 days ago
Intervention ImageIntervention Image

PHP Image Processing

Stars14,356
Forks1,495
Last commit5 days ago
Community-curated · Updated weekly · 100% open source

Found a gem we're missing?

Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.

Submit a projectStar on GitHub