Skip to content

Commit fdeb860

Browse files
authored
Merge pull request #3 from StelianAndrei/fix/post-install-exception
Fixes postInstall and postUpdate Exception
2 parents 53e05f5 + f70b3ad commit fdeb860

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/CleanActivitylogCommand.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,9 @@ public function handle()
3030

3131
$cutOffDate = Carbon::now()->subDays($maxAgeInDays)->format('Y-m-d H:i:s');
3232

33-
$amountDeleted = (ActivitylogServiceProvider::getActivityModelClass())::where('created_at', '<', $cutOffDate)->delete();
33+
$activityModelClass = '\\' . ActivitylogServiceProvider::getActivityModelClass();
34+
$activity = new $activityModelClass;
35+
$amountDeleted = $activity->where('created_at', '<', $cutOffDate)->delete();
3436

3537
$this->info("Deleted {$amountDeleted} record(s) from the activity log.");
3638

0 commit comments

Comments
 (0)