noxoua / filament-activity-log

Add-on for simplified activity logging based on spatie package.
http://activity-log.noxo.app/
MIT License
66 stars 14 forks source link

[Bug]: Attempted to lazy load [causer] on model [Spatie\Activitylog\Models\Activity] but lazy loading is disabled. #60

Closed piotrh052b closed 4 months ago

piotrh052b commented 10 months ago

What happened?

Cannot display activity log if Model lazy loading is disabled.

How to reproduce the bug

Add Model::shouldBeStrict(); in AppServiceProvider boot() method. Make some changes in records. Try to display Activity history.

Package Version

2.2.0

PHP Version

8.1

Laravel Version

10.41

Which operating systems does with happen with?

Windows

Notes

No response

piotrh052b commented 10 months ago

I think I found a solution by overriding the getActivities() method

public function getActivities() { return $this->paginateTableQuery( $this->applyFilters(Activity::with(['causer'])->latest()) ); }

Is this a correct solution ?

afsakar commented 3 months ago

It's seems fixed but you didn't add last release this PR.