mirror of
https://github.com/flarum/framework.git
synced 2025-02-18 12:33:22 +08:00
Unapprove discussions too
This commit is contained in:
parent
5b79abeea1
commit
9c6466338c
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue
Block a user