Unapprove discussions too

This commit is contained in:
Toby Zerner 2016-06-03 10:58:05 +09:30
parent 5b79abeea1
commit 9c6466338c

View File

@ -75,6 +75,11 @@ class FilterNewPosts
$post->is_spam = true;
$post->afterSave(function ($post) {
if ($post->number == 1) {
$post->discussion->is_approved = false;
$post->discussion->save();
}
$flag = new Flag;
$flag->post_id = $post->id;