Overview
Lunar has activity logging built in to track changes on Eloquent models. This provides an invaluable insight into what updates are happening in a store and who is making them.How it works
Lunar uses the laravel-activitylog package by Spatie under the hood, wrapped in a custom trait atLunar\Base\Traits\LogsActivity. This trait configures the following defaults:
- All attribute changes are logged (except
updated_at) - Only dirty (changed) attributes are recorded
- Empty logs are not submitted
- All entries are stored under the
lunarlog name
Enabling on your own models
To enable logging on custom models, use Lunar’s trait rather than Spatie’s directly. This ensures consistent configuration across the application.getDefaultLogExcept method: