-
-
Notifications
You must be signed in to change notification settings - Fork 740
Open
Description
Describe the bug
logUnguarded() works provided that $guarded is set explicitly in the model. If it is not set explicitly but globally set, say in AppServiceProvider using Model::unguard(); then nothing is logged.
To Reproduce
- remove
$fillableand$guardedfrom a model that use usesLogsActivity - call
Model::unguard();inAppServiceProviderin thebootmethod - set
public function getActivitylogOptions() : LogOptions
{
return LogOptions::defaults()->logUnguarded();
}
- Make some changes to a model and save them
Expected behavior
Some changed properties should be logged but none are
Versions (please complete the following information)
- PHP: 8.1
- Database: MySql
- Laravel: 9.38
- Package: larvel-activitylog