Introduction
Callbacks let you run code automatically at certain points in an object's life. They help keep your code organized and avoid repeating yourself.
You want to set a default value before saving a record.
You need to clean or format data before saving it.
You want to send a notification right after a record is created.
You want to check or prevent something before deleting a record.
You want to log changes automatically when a record updates.