This is the documentation for
v3 but the latest version is
v4
.
You can switch versions in the menu on the left/at the top.
Check your current version with the following command:
composer show spatie/laravel-activitylog
You can disable all logging activities in the current request by calling
activity()->disableLogging();
If you want to enable logging again call activity()->enableLogging()
.
##without Logs
If you want to run a given code snippet without logs you can use the withoutLogs()
method.
activity()->withoutLogs(function () {
// ...
});
Everything that would produce an activitylog (model events, explicit calls) won't save an activity.