Skip to content
This repository has been archived by the owner on Jun 1, 2019. It is now read-only.

Commit

Permalink
Merge pull request #37 from mul14/patch-1
Browse files Browse the repository at this point in the history
Remove double Contributing info
  • Loading branch information
sebastiandedeyne committed Apr 6, 2016
2 parents b734982 + 825370c commit 6694333
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand All @@ -151,7 +151,7 @@ class BeforeHandler implements BeforeHandlerInterface
public function shouldLog($text, $userId)
{
if ($userId == 1) return false;

return true;
}
}
Expand All @@ -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:
Expand Down

0 comments on commit 6694333

Please sign in to comment.