Skip to content

Releases: multicaret/laravel-acquaintances

v4.0.0-beta.1

v4.0.0-beta.1 Pre-release
Pre-release

Choose a tag to compare

@mkwsra mkwsra released this 09 Apr 15:41

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: v3.7.3...v4.0.0-beta.1

v3.7.3

Choose a tag to compare

@mkwsra mkwsra released this 06 Aug 12:43
5802206

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

v3.7.2

Choose a tag to compare

@mkwsra mkwsra released this 23 Mar 22:13
  • fix: RELATION_REPORT instead of RELATION_FAVORITE in CanBeReported class. #117 thanks to @simone-bianco

v3.7.1

Choose a tag to compare

@mkwsra mkwsra released this 17 Feb 16:11

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

v3.7.0

Choose a tag to compare

@mkwsra mkwsra released this 17 Feb 16:10

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

v3.6.2

Choose a tag to compare

@mkwsra mkwsra released this 17 Feb 15:14
  • feat: new functions added followingCount() and followingCountReadable() thanks to @jayenne <3. PR #115

v3.6.1

Choose a tag to compare

@mkwsra mkwsra released this 08 Jun 13:48
ae1c4ae

use config variable interactions_user_id_fk_column_name #109 thanks to @adriallongarriu

v3.6.0

Choose a tag to compare

@mkwsra mkwsra released this 19 Mar 00:05
31d5b85

Bump Laravel support to V11.

v3.5.9

Choose a tag to compare

@mkwsra mkwsra released this 28 Nov 17:11
  • 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

Choose a tag to compare

@mkwsra mkwsra released this 22 Mar 20:37
74038bc
  • feat: adding get pending count function by @prawn185
  • fix: solve isRelationExists causing potential ambiguous errors when doing some complex DB queries. by @midblep