I have two models tag
and post
. When i create the tag I assign it like Post::find(1)->tags()->sync([1])
. On each sync
I want to increment/decrement tags countert. So basically I need just to call own method when sync is called. Is it possible?
Listen for the event. Laravel support many events out of the box.
jacksoncharles said:
Listen for the event. Laravel support many events out of the box.
Could you provide an example?
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community