mirror of
https://github.com/flarum/core.git
synced 2025-07-31 13:40:20 +02:00
Add actor information to the PostWasApproved event
This commit is contained in:
@@ -11,6 +11,7 @@
|
||||
namespace Flarum\Approval\Event;
|
||||
|
||||
use Flarum\Core\Post;
|
||||
use Flarum\Core\User;
|
||||
|
||||
class PostWasApproved
|
||||
{
|
||||
@@ -22,10 +23,17 @@ class PostWasApproved
|
||||
public $post;
|
||||
|
||||
/**
|
||||
* @param Post $post
|
||||
* @var User
|
||||
*/
|
||||
public function __construct(Post $post)
|
||||
public $actor;
|
||||
|
||||
/**
|
||||
* @param Post $post
|
||||
* @param User $actor
|
||||
*/
|
||||
public function __construct(Post $post, User $actor)
|
||||
{
|
||||
$this->post = $post;
|
||||
$this->actor = $actor;
|
||||
}
|
||||
}
|
||||
|
@@ -47,7 +47,7 @@ class ApproveContent
|
||||
if (! empty($isApproved)) {
|
||||
$post->is_approved = true;
|
||||
|
||||
$post->raise(new PostWasApproved($post));
|
||||
$post->raise(new PostWasApproved($post, $event->actor));
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user