How to observe Many to Many relation attach()/sync() action?
For this: I have Tag model and Post model, their raletion is Many to Many. I want to $tag->count += 1 when Post attach() with a Tag.
How to do that?
I suggest you create the model events from creating, created, updating and updated. check which event is fired during the attach()/sync().
@Gwill you're right, there are no such events. Here's something you may use http://stackoverflow.com/questions/28925292/eloquent-attach-detach-sync-fires-any-event
Sign in to participate in this thread!