sync(), attach(), or detach()).BelongsToMany methods.id/model_id/related_id); consider laravel-many-to-many.For Executives:
*"This package solves a hidden pain point in Laravel’s Eloquent: when relationships (e.g., user-roles, product-tags) are updated via sync() or attach(), Laravel silently skips events—missing opportunities for automation, auditing, or workflows. By adding 6 new event hooks (e.g., pivotAttached, pivotUpdated), we can:
For Engineering:
*"This fills a gap in Laravel’s native Eloquent: pivot table operations (sync(), attach()) don’t dispatch events, forcing us to:
PivotEventTrait to models to unlock events like pivotAttaching or pivotUpdated. Example:// Before: Silent sync()
$user->roles()->sync([1, 2]);
// After: Triggerable!
$user->roles()->sync([1, 2]); // Dispatches pivotAttaching/pivotAttached
Tradeoffs: Minimal performance impact (~1ms/event); requires Laravel 5.5+. Let’s prototype with the [User-Role] use case first."*
How can I help you explore Laravel packages today?