Weave Code
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

Laravel Acquaintances Laravel Package

multicaret/laravel-acquaintances

View on GitHub
Deep Wiki
Context7
v4.0.0-beta.1

v4.0.0-beta.1

Breaking Changes

  • PHP >= 8.1 required — dropped PHP 8.0 support.
  • Strict return types — all trait and model methods now declare explicit return types. If you override any method from the package traits, update your signatures accordingly.
  • un*() methods return intunlike(), unfollow(), unfavorite(), unsubscribe(), unview(), unreport(), and unrate() now return int (detached count) instead of array.

New Features

  • feat: UUID / ULID morph support — configurable morph_type per table (morphs, uuidMorphs, ulidMorphs) via the interactions_morph_type, friendships_morph_type, verifications_morph_type, and related config keys.
  • feat: Caching layer — new cache config section with enabled, store, and ttl options. Interaction::isRelationExists() now uses an in-memory request cache and an optional persistent cache (Cache::remember) with automatic invalidation on attach/detach/toggle.
  • feat: withAcquaintanceCounts() Eloquent Builder macro — new AcquaintanceScopes class registers a macro to eager-load interaction counts (likers, followers, subscribers, etc.) in a single query.
  • feat: HasAcquaintanceCounters trait — auto-increment/decrement cached counter columns (e.g. likes_count, followers_count) on the model's table when interactions change.
  • feat: AcquaintancesCleanupJob — queued job to clean up all acquaintance data for a deleted model without blocking the request.
  • feat: Morph map registration — the service provider now registers morph maps for Friendship, FriendshipGroups, Verification, VerificationGroups, and InteractionRelation models automatically, with Relation::enforceMorphMap() support.
  • feat: Interactions-only mode — new features config section (interactions, friendships, verifications) to selectively enable/disable features. Disabled features skip migration loading and publishing. Granular publish tags added: acquaintances-migrations-interactions, acquaintances-migrations-friendships, acquaintances-migrations-verifications.
  • feat: Custom User model support — new user_model_class_name config key allows specifying a fully qualified User model class (e.g., App\Models\Core\User) for projects with non-standard model locations.

Improvements

  • perf: Database indexes — added composite and unique indexes on interactions, friendships, and verifications tables for faster lookups.
  • refactor: Migrations converted to anonymous classes — following Laravel 9+ conventions.
  • refactor: DB::transaction() wrappersblockFriend() and blockVerification() now run inside database transactions for atomicity.
  • refactor: Laravel 13 support — added ^13.0 to Illuminate component constraints.
  • test: MySQL test infrastructure — all tests now run against MySQL via Orchestra Testbench; event tests modernized from Mockery to Event::fake().

Full Changelog: https://github.com/multicaret/laravel-acquaintances/compare/v3.7.3...v4.0.0-beta.1

v3.7.3

Fix PHP 8.4 compatibility: Add explicit nullable type declaration for followingCountReadable #119 thanks to @Neveark

v3.7.2
  • fix: RELATION_REPORT instead of RELATION_FAVORITE in CanBeReported class. #117 thanks to @simone-bianco
v3.7.1

fix: numberToReadable will return an int if the $shorthand is empty. by @jayenne

v3.7.0

feat: new trait for reporting added by @jayenne. PR #116

v3.6.2
  • feat: new functions added followingCount() and followingCountReadable() thanks to @jayenne <3. PR #115
v3.6.1

use config variable interactions_user_id_fk_column_name #109 thanks to @adriallongarriu

v3.6.0

Bump Laravel support to V11.

v3.5.9
  • feat: adding a way to get a list of blocked Friendships by current user by @mercExec
  • feat: adding a way to get a list of blocked Friendships by others by @mercExec
v3.5.8
  • feat: adding get pending count function by @prawn185
  • fix: solve isRelationExists causing potential ambiguous errors when doing some complex DB queries. by @midblep
v3.5.7

Laravel 10 support

v3.5.6

fix: findFriendships() with params sender & recipient were not working, fixed by @beratkara

v3.5.5

Add cursor paginate support to getFriends and getOrPaginate

v3.5.4
  • fix: make interaction relation_value type a double, better for rating values.
  • fix: rating a non-custom type (AKA config('acquaintances.rating.defaults.type')) just after a custom type rating, will leave to an odd behavior
v3.5.3

feat: allow user to turn off migrations

v3.5.2

fix: replace deprecated method studly_case()

v3.5.1

Fix Trait helper method morph key.

Thanks to @Necmttn

v3.5.0

Rename collision method name 'ratings' to 'ratingsTo'

v3.4.7
  • feat: change the naming of migration files to be prefixed with the current time.
v3.4.6
  • fix: friendship_id column type

close #40

v3.4.5

Thanks to @jaulz

  • fix: use a custom model for downvotes
  • fix: read pivot id
v3.4.4

Thanks to @RJFares

  • fix: in interaction table add update_at timestamp column
v3.4.3

Thanks to @jaulz

  • feat: allow empty model namespace
  • fix: add helper methods for all models
  • feat: allow all models to be configured
  • fix: use models from config
  • fix: set default user model to User
  • along with other fixes
v3.4.2

Thanks to @jaulz

  • feat: add view relation
  • feat: add CanBeViewed trait
  • feat: add CanView trait
  • docs: extend readme
  • docs: add missing events
  • fix: fix typo
  • feat: extend relation map
v3.4.1

Thanks to @jaulz

  • fix: add option for custom column name
  • feat: add helper method to get user model name
  • fix: use helper method to get user model name
  • fix: remove obsolete imports
  • fix: add Str import
  • fix: fix comments in config
  • fix: use helper method to get user model name
  • fix: use new helper method to get user model name
  • fix: use new helper method get user model name
  • fix: use new helper method get user model name
  • fix: use new helper method get user model name
  • fix: use new helper method get user model name
v3.4.0
  • Fixed CanVote by replacing str_plural with Str::plural.
v3.3.1
  • Added ratings() & ratingsPure() to CanBeRated model
  • Added user model name to configs user_model_class_name
  • Added user relation to InteractionRelation model
v3.3.0

Minor fix:

  • Fixed the logic of allTypes post-fixed functions
v3.2.0

v3.2.0

  • Removed avoiding querying ratings when the type is set to overall

  • Fixed the value of userSumRatingReadable() function in CanBeRated trait.

  • Fixed userSumRatingReadable() function in CanBeRated trait.

  • Add new functions to CanBeRated trait:

    • averageRatingAllTypes()
    • sumRatingAllTypes()
    • sumRatingAllTypesReadable()
    • userAverageRatingAllTypes()
    • userSumRatingAllTypes()
    • userSumRatingAllTypesReadable()
    • ratingPercentAllTypes()
    • getAverageRatingAllTypesAttribute()
    • getSumRatingAllTypesAttribute()
    • getUserAverageRatingAllTypesAttribute()
    • getUserSumRatingAllTypesAttribute()
  • Added a proper param type hint for the $target param in the following traits

    • CanBeFavorited
    • CanBeFollowed
    • CanBeLiked
    • CanBeRated
    • CanBeSubscribed
    • CanBeVoted
    • CanFavorite
    • CanFollow
    • CanLike
    • CanRate
    • CanSubscribe
    • CanVote
v3.1.0

made the user_id FK type dynamic and part of configurations

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.
emuniq/filament-browser-notifications
syriable/filament-translator
hungnm28/livewire-form
wenprise/eloquent
crudly/encrypted
fadion/bouncy
cuci/prototurk-sdk
gos/pubsub-router-bundle
cuci/prototurk-sdk-symfony
clementtalleu/easyadmin-markdown-bundle
codeflextech/permission-manager
karnoweb/livewire-datepicker
sayedenam/sayed-dashboard
milito/query-filter
apiboxsym/user-bundle
apiboxsym/health-check-bundle
jayeshmepani/jpl-moshier-ephemeris-php
elnasnato/laraliveui
labrodev/rest-sdk
sampaui/sampaui