multicaret/
laravel-acquaintances
g4t.io

Manage Friendships, Likes and More with the Acquaintances Laravel Package

17 views 850 stars by Paul Redmond

This light package, with no dependencies, gives Eloquent models the ability to manage friendships (with groups), verifications, and interactions such as: Likes, favorites, votes, subscribe, follow, ..etc. And it includes advanced rating system.

README from multicaret/laravel-acquaintances Open on GitHub →

Laravel Acquaintances

Total Downloads Latest Version License

Clean, modular social features for Eloquent models: Friendships, Verifications, Interactions (Follow/Like/Favorite/Report/Subscribe/Vote/View), and multi-type Ratings.

What's New in v4

  • UUID / ULID morph support — configurable per table via morphs, uuidMorphs, or ulidMorphs.
  • Caching layer — in-memory request cache + optional persistent cache for interaction checks with automatic invalidation.
  • withAcquaintanceCounts() macro — eager-load interaction counts in a single query.
  • HasAcquaintanceCounters trait — auto-increment/decrement counter columns on your model's table.
  • AcquaintancesCleanupJob — queued mass deletion of acquaintance data for deleted models.
  • Database indexes — composite and unique indexes on all tables for faster lookups.
  • Morph map registration — automatic morph map for all package models.
  • Strict return types on all traits and models.
  • DB transactions for blockFriend() and blockVerification().
  • Interactions-only mode — disable friendships and/or verifications via features config to skip their migrations entirely. Granular per-feature publish tags available.

See CHANGELOG.md for the full list and Upgrade Notes for migration steps.

TL;DR

$user1 = User::find(1);
$user2 = User::find(2);

// Friendships
$user1->befriend($user2);
$user2->acceptFriendRequest($user1);

// The messy breakup :(
$user2->unfriend($user1);

// Verifications (message is optional)
$user1->verify($user2, "Worked together on several Laravel projects.");
$user2->acceptVerificationRequest($user1);

if ($user1->isVerifiedWith($user2)) {
    echo "Verified!";
}

Documentation

To keep this README concise, the full documentation lives under docs/:

Quickstart

  1. Install
composer require multicaret/laravel-acquaintances
  1. Publish (optional) and migrate
php artisan vendor:publish --provider="Multicaret\\Acquaintances\\AcquaintancesServiceProvider"
php artisan migrate

Interactions-Only Mode

If you only need interactions (Follow, Like, Favorite, Subscribe, Vote, View, Report, Rate) and don't need Friendships or Verifications, disable them in config/acquaintances.php:

'features' => [
    'interactions' => true,
    'friendships' => false,
    'verifications' => false,
],

This prevents friendship and verification migrations from being loaded or published, keeping your database lean.

You can also publish migrations for specific features using granular tags:

# Only interaction migrations
php artisan vendor:publish --tag=acquaintances-migrations-interactions

# Only friendship migrations
php artisan vendor:publish --tag=acquaintances-migrations-friendships

# Only verification migrations
php artisan vendor:publish --tag=acquaintances-migrations-verifications

Custom User Model Location

If your User model lives in a non-standard namespace (e.g., App\Models\Core\User), set user_model_class_name in config/acquaintances.php:

'user_model_class_name' => \App\Models\Core\User::class,

When null (default), the package resolves the user model from model_namespace + models.user (i.e., App\Models\User).

  1. Add traits to your models
use Multicaret\\Acquaintances\\Traits\\Friendable;
use Multicaret\\Acquaintances\\Traits\\Verifiable;
use Multicaret\\Acquaintances\\Traits\\CanFollow;
use Multicaret\\Acquaintances\\Traits\\CanBeFollowed;
use Multicaret\\Acquaintances\\Traits\\CanLike;
use Multicaret\\Acquaintances\\Traits\\CanBeLiked;
use Multicaret\\Acquaintances\\Traits\\CanRate;
use Multicaret\\Acquaintances\\Traits\\CanBeRated;

class User extends Model {
    use Friendable, Verifiable;
    use CanFollow, CanBeFollowed;
    use CanLike, CanBeLiked;
    use CanRate, CanBeRated;
}

Explore the feature guides linked above for full APIs and examples.

Compatibility

Version PHP Laravel
v4 >= 8.1 9, 10, 11, 12, 13
v3.x >= 8.0 9, 10, 11, 12

Contributing / Changelog

  • Contributing: see CONTRIBUTING.md
  • Changes: see CHANGELOG.md

More from the ecosystem

durable-workflow/
workflow
g4t.io
9 1,292

Durable Workflow: Long-Running Workflows for Laravel

Embedded durable workflow runtime and orchestration engine for Laravel applications.

durable-workflow/workflow via Laravel News
packstub/
session-replay
g4t.io
14 52

Session Replay for Laravel: Self-Hosted Browser Recordings

Session replay for Laravel: record what a person did in the browser with rrweb, keep the recording on your own disk and database, and watch it behind a gate you define — masked inputs by default, errors, failed Livewire requests and web vitals marked on the timeline, a link to the replay in every log line. packstub/filament-session-replay adds the sessions to a Filament panel.

packstub/session-replay via Laravel News
cyberwizard-dev/
schedule-catchup
g4t.io
17

Replay Missed Laravel Scheduled Tasks With Schedule Catchup

Schedule Catchup replays missed Laravel scheduled tasks after downtime, with opt-in recovery, bounded retries, and access to the original scheduled date.

cyberwizard-dev/schedule-catchup via Laravel News