Closed giolaza closed 6 days ago
are you able to try 13.6.6 as well? are you able to share your config file?
checked 13.6.6 same problem config file - audit.php is not published (default used)
additionally i see: log created for model in 13.6.5 is deleted for some reason
As per #947 this behaviour happens when the audit.threshold
value is higher than 0. Is your code definitely not changing that one value at any point even if the config file isn't used? Can you output the value from php artisan tinker
to confirm what it is?
found issue in
vendor/owen-it/laravel-auditing/src/Drivers/Database.php
here is db log:
\Illuminate\Support\Facades\DB::enableQueryLog(); $model->audits() ->latest() ->offset($threshold)->limit(PHP_INT_MAX) ->delete() > 0; $queries = \Illuminate\Support\Facades\DB::getQueryLog(); dd($queries);
delete from
auditswhere
audits.
auditable_type= ? and
audits.
auditable_id= ? and
audits.
auditable_idis not null order by
created_atdesc limit 9223372036854775807
delete method is ignoring offset method. this is reason why logs are removing("not creating")
If audit.threshold = 0
, that delete should never be executed
https://github.com/owen-it/laravel-auditing/blob/22682dd5c800aab90ef261530098625e26a66709/src/Drivers/Database.php#L25
unless you have the auditThreshold
property on that model, on that case, this would be a duplicate of #947
https://github.com/owen-it/laravel-auditing/blob/22682dd5c800aab90ef261530098625e26a66709/src/Auditable.php#L616-L619
checked, forgot that in model I set limit for rows 1000000
Hi, test new changes on #948
PHP Version
8.1
Laravel Version
9.52.16
Package Version
13.6.7
Description
Default installation used. On version 13.6.5 was working good, but after updating project to 13.6.7 logs stopped. Downgrade helped
Steps To Reproduce
Basic install. Use 13.6.5 - all is good Use 13.6.7 - no logs
Possible Solutions
No response