Skip to content
This repository has been archived by the owner on Mar 14, 2024. It is now read-only.

Commit

Permalink
Fix usage of getTable
Browse files Browse the repository at this point in the history
  • Loading branch information
besologic committed Jul 15, 2016
1 parent 2e656e9 commit 0cbc49b
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/DeleteOldSoftDeletes.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,11 @@ private function deleteOldSoftDeletesForModel($modelName, $modelConfig, $daysBef
{
$daysBeforeDeletion = empty($modelConfig['days']) ? $daysBeforeDeletion : $modelConfig['days'];

return [$modelName => DB::table((new $modelName)::getTableName())
$affectedRows = DB::table((new $modelName)->getTable())
->where('deleted_at', '<', Carbon::today()->subDays($daysBeforeDeletion))
->delete()];
->delete();

return [$modelName => $affectedRows];
}

private function logAffectedRows(Collection $deletedRows)
Expand Down

0 comments on commit 0cbc49b

Please sign in to comment.