Releases: multicaret/laravel-acquaintances
Releases · multicaret/laravel-acquaintances
Release list
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 returnint—unlike(),unfollow(),unfavorite(),unsubscribe(),unview(),unreport(), andunrate()now returnint(detached count) instead ofarray.
New Features
- feat: UUID / ULID morph support — configurable
morph_typeper table (morphs,uuidMorphs,ulidMorphs) via theinteractions_morph_type,friendships_morph_type,verifications_morph_type, and related config keys. - feat: Caching layer — new
cacheconfig section withenabled,store, andttloptions.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 — newAcquaintanceScopesclass registers a macro to eager-load interaction counts (likers, followers, subscribers, etc.) in a single query. - feat:
HasAcquaintanceCounterstrait — 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, andInteractionRelationmodels automatically, withRelation::enforceMorphMap()support. - feat: Interactions-only mode — new
featuresconfig 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_nameconfig 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()wrappers —blockFriend()andblockVerification()now run inside database transactions for atomicity. - refactor: Laravel 13 support — added
^13.0to 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