laravel-auditing icon indicating copy to clipboard operation
laravel-auditing copied to clipboard

Does threshold limit remove over the limit entries?

Open michaelnguyen2021 opened this issue 5 years ago • 0 comments

Q A
Bug? maybe
New Feature? no
Framework Laravel
Framework version 5.8
Package version 9.0
PHP version 7.2

Actual Behaviour

There are 800 entries of the auditable type. I only want to keep around 100, so I set the

protected $auditThreshold = 10;

When I create a new model and update it, it is saved to audits table, but the total entries are 801.

Do I have to run some kind of command to prune the entries manually?

Expected Behaviour

The audit threshold should be respected and the total entries should be 10, instead of 801.

Steps to Reproduce

  1. Create 20 entries of the same auditable type

  2. Set $auditThreshold to 10

  3. Create and Update a new auditable type model

  4. Check database

Possible Solutions

N/A

michaelnguyen2021 avatar Sep 19 '19 22:09 michaelnguyen2021