Back to Laravel Activitylog

Disabling logging

docs/advanced-usage/disabling-logging.md

5.0.0680 B
Original Source

You can disable all logging globally for the current request by calling

php
activity()->disableLogging();

If you want to enable logging again, call activity()->enableLogging().

Without logging

If you want to run a block of code without any logging, you can use the withoutLogging() method.

php
activity()->withoutLogging(function () {
    // ...
});

Everything that would produce an activitylog (model events, explicit calls) won't save an activity.

To disable logging for a specific model instance instead of globally, see the per-model disabling section.