When working with Eloquent Models, it is common to tap into the events dispatched through the Models lifecycle. This example will assign the model’s UUID property to a UUID during the creation of the model itself.
Model Observers are a class-based approach to reacting to model events, where the methods correspond to the specific events being fired.
This is a property on every Eloquent Model that allows you to list the events you want to listen for and a class called for these events.
The SetModelUuid will be instantiated during the lifecycle of the Eloquent model and is your chance to add behavior and properties to the model.