Conditions | 2 |
Paths | 2 |
Total Lines | 13 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Tests | 9 |
CRAP Score | 2 |
Changes | 0 |
1 | <?php |
||
60 | 2 | public function setDestroyed() |
|
61 | { |
||
62 | 2 | $deadmanList = User::where('status', '!=', 'active') |
|
63 | 2 | ->where('destroyed_date', '<=', Carbon::today()) |
|
64 | 2 | ->get(); |
|
65 | |||
66 | 2 | foreach ($deadmanList as $user) { |
|
67 | 2 | Storage::deleteDirectory('user_'.$user->id); |
|
68 | 2 | $user->delete(); |
|
69 | } |
||
70 | |||
71 | 2 | $this->destroyed = $deadmanList; |
|
72 | 2 | } |
|
73 | } |
||
74 |