Skip to content

Commit 1a198cc

Browse files
author
CrashSensei
committed
Used existing class instance creation function
1 parent fdeb860 commit 1a198cc

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/CleanActivitylogCommand.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,7 @@ public function handle()
3030

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

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

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

0 commit comments

Comments
 (0)