Skip to content
This repository has been archived by the owner on May 21, 2021. It is now read-only.

Commit

Permalink
Fix for not finding already deleted models
Browse files Browse the repository at this point in the history
  • Loading branch information
Robert-Hucks authored Jan 9, 2019
1 parent 7001c87 commit 531c1f9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Console/Kernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ protected function schedule(Schedule $schedule)
$date = new \DateTime();
$models = Destructor::whereDate('ttl', '<=', $date->format('Y-m-d'))->whereTime('ttl', '<=', $date->format('H:i:s'))->get();
foreach($models as $model) {
$model->deletable_type::find($model->deletable_id)->delete();
$model->deletable_type::withTrashed()->find($model->deletable_id)->delete();
$model->delete();
}
})->everyMinute();
}
}
}

0 comments on commit 531c1f9

Please sign in to comment.