diff --git a/app/Console/Commands/Purge.php b/app/Console/Commands/Purge.php index de7b518fb5..8abe6048c9 100644 --- a/app/Console/Commands/Purge.php +++ b/app/Console/Commands/Purge.php @@ -62,15 +62,19 @@ class Purge extends Command $assetcount = $assets->count(); $this->info($assets->count().' assets purged.'); $asset_assoc = 0; + $asset_maintenances = 0; foreach ($assets as $asset) { $this->info('- Asset "'.$asset->showAssetName().'" deleted.'); $asset_assoc += $asset->assetlog()->count(); $asset->assetlog()->forceDelete(); + $asset_maintenances += $asset->assetmaintenances()->count(); + $asset->assetmaintenances()->forceDelete(); $asset->forceDelete(); } $this->info($asset_assoc.' corresponding log records purged.'); + $this->info($asset_maintenances.' corresponding maintenance records purged.'); $locations = Location::whereNotNull('deleted_at')->withTrashed()->get(); $this->info($locations->count().' locations purged.');