Skip to content

Commit 4bda80b

Browse files
committed
Delete posts belonging to threads that have been permanently bulk-deleted
1 parent 6d8f540 commit 4bda80b

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

src/Actions/Bulk/DeleteThreads.php

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,12 @@
33
namespace TeamTeaTime\Forum\Actions\Bulk;
44

55
use Illuminate\Support\Facades\DB;
6-
use TeamTeaTime\Forum\Actions\BaseAction;
7-
use TeamTeaTime\Forum\Models\BaseModel;
8-
use TeamTeaTime\Forum\Models\Thread;
6+
use TeamTeaTime\Forum\{
7+
Actions\BaseAction,
8+
Models\BaseModel,
9+
Models\Post,
10+
Models\Thread,
11+
};
912

1013
class DeleteThreads extends BaseAction
1114
{
@@ -83,6 +86,10 @@ protected function transact()
8386
$category->update($updates);
8487
}
8588

89+
if ($this->permaDelete) {
90+
Post::whereIn('thread_id', $this->threadIds)->withTrashed()->forceDelete();
91+
}
92+
8693
return $threads;
8794
}
8895
}

0 commit comments

Comments
 (0)