diff --git a/framework/core/src/Core/Commands/EditDiscussionCommand.php b/framework/core/src/Core/Commands/EditDiscussionCommand.php index ffdd2d5c7..f986daa12 100644 --- a/framework/core/src/Core/Commands/EditDiscussionCommand.php +++ b/framework/core/src/Core/Commands/EditDiscussionCommand.php @@ -6,11 +6,12 @@ class EditDiscussionCommand public $user; - public $title; + public $data; - public function __construct($discussionId, $user) + public function __construct($discussionId, $user, $data) { $this->discussionId = $discussionId; $this->user = $user; + $this->data = $data; } } diff --git a/framework/core/src/Core/Handlers/Commands/EditDiscussionCommandHandler.php b/framework/core/src/Core/Handlers/Commands/EditDiscussionCommandHandler.php index 4f8ab6f1c..49c1b8ec0 100644 --- a/framework/core/src/Core/Handlers/Commands/EditDiscussionCommandHandler.php +++ b/framework/core/src/Core/Handlers/Commands/EditDiscussionCommandHandler.php @@ -22,8 +22,8 @@ class EditDiscussionCommandHandler $discussion->assertCan($user, 'edit'); - if (isset($command->title)) { - $discussion->rename($command->title, $user); + if (isset($command->data['title'])) { + $discussion->rename($command->data['title'], $user); } event(new DiscussionWillBeSaved($discussion, $command));