mirror of
https://github.com/flarum/framework.git
synced 2025-02-21 08:22:41 +08:00
Add actor information to the PostWasApproved event
This commit is contained in:
parent
ff6e674854
commit
9f4e11097d
@ -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));
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user