Laravel Relationship Events

Laravel Relationship Events is a package by Viacheslav Ostrovskiy that adds extra model relationship events. This package comes with the following traits that are used to register listeners on a model’s boot() method:

HasOneEvents

HasBelongsToEvents

HasManyEvents

HasBelongsToManyEvents

HasMorphOneEvents

HasMorphToEvents

HasMorphManyEvents

HasMorphToManyEvents

HasMorphedByManyEvents

And from the above traits, here’s an example of a few events on a Country model that has many Users using the HasManyEvents trait: