diff --git a/src/Illuminate/Database/Eloquent/BroadcastsEvents.php b/src/Illuminate/Database/Eloquent/BroadcastsEvents.php index f6644e5d3f00..008fb128afce 100644 --- a/src/Illuminate/Database/Eloquent/BroadcastsEvents.php +++ b/src/Illuminate/Database/Eloquent/BroadcastsEvents.php @@ -124,7 +124,7 @@ protected function broadcastIfBroadcastChannelsExistForEvent($instance, $event, */ public function newBroadcastableModelEvent($event) { - return tap($this->withBroadcastableEvent(new BroadcastableModelEventOccurred($this, $event)), function ($event) { + return tap($this->newBroadcastableEvent($event), function ($event) { $event->connection = property_exists($this, 'broadcastConnection') ? $this->broadcastConnection : $this->broadcastConnection(); @@ -140,14 +140,14 @@ public function newBroadcastableModelEvent($event) } /** - * Configure the broadcastable model event for the model. + * Create a new broadcastable model event for the model. * - * @param \Illuminate\Database\Eloquent\BroadcastableModelEventOccurred $event + * @param string $event * @return \Illuminate\Database\Eloquent\BroadcastableModelEventOccurred */ - protected function withBroadcastableEvent(BroadcastableModelEventOccurred $event) + protected function newBroadcastableEvent($event) { - return $event; + return new BroadcastableModelEventOccurred($this, $event); } /**