diff --git a/README.md b/README.md index 9992cb7..471ced1 100644 --- a/README.md +++ b/README.md @@ -125,13 +125,13 @@ public function getActivityDescriptionForEvent($eventName) The result of this function will be logged, unless the result is an empty string. ### Using a before handler. -If you want to disable logging under certain conditions, +If you want to disable logging under certain conditions, such as for a specific user, create a class in your application -namespace that implements the `Spatie\Activitylog\Handlers\BeforeHandlerInterface`. +namespace that implements the `Spatie\Activitylog\Handlers\BeforeHandlerInterface`. This interface defines an `shouldLog()` method in which you can code any custom logic to determine whether logging should be ignored or not. You must return `true` the call should be logged. - + To en the namespaced class nameto the `beforeHandler` field in the configuration file: ```php 'beforeHandler' => '\App\Handlers\BeforeHandler', @@ -151,7 +151,7 @@ class BeforeHandler implements BeforeHandlerInterface public function shouldLog($text, $userId) { if ($userId == 1) return false; - + return true; } } @@ -166,10 +166,6 @@ use Spatie\Activitylog\Models\Activity; $latestActivities = Activity::with('user')->latest()->limit(100)->get(); ``` -## Contributing - -Please see [CONTRIBUTING](CONTRIBUTING.md) for details. - ### Cleaning up the log Over time your log will grow. To clean up the database table you can run this command: