Where to send notification after relationship created

Hi guys, I have two simple models: Task and User. There is belongsToMany relationship between these two. In my Task resource I have Select::multiple() and also UsersRelationManager. In User resource I have TasksRelationManager. I want to send notification each time new user is assigned to task. Where do you suggest to place this part? I tried it inside TaskObserver on created method, but Filament is saving relationships after first commit, so there is no $task->users on created method.
2 Replies
Dan Harrin
Dan Harrin7mo ago
how about creating a pivot model TaskUser and observing that
Trauma Zombie
Trauma ZombieOP7mo ago
Good idea. I keep forgetting about this option. Thank you, Dan!
Want results from more Discord servers?
Add your server