📄️ Logging model events
To log model events, simply add the LogsActivity trait to your model.
📄️ Customizing attributes being logged
To customize which attributes you want to log, you can use the $logAttributes static property on your model. For example to only log the name and slug:
📄️ Ignoring changes to certain attributes
If you want to ignore changes to certain attributes, you can use the $ignoreChangedAttributes static property on your model. In the example below a log won't be created if only the updatedat or createdat attributes changes:
📄️ Prevent specific attributes being logged
To prevent certain attributes ever being logged, you can use the $logExceptAttributes static property on your model. For example to never log the password: