尝试触发事件时序列化()错误

时间:2016-08-25 10:42:18

标签: laravel laravel-5.3

我从昨天起就试图调试这个错误而没有运气。我试图通过Pusher播放一个事件然后用Echo进行广播,奇怪的是那个它适用于9条消息,然后它就停止了工作,即使它工作时仍然会抛出错误,这是工匠修补匠的错误:

http://i.imgur.com/aTVW5WM.png

活动:

class ClientAdded extends Event implements ShouldBroadcast
{
    use InteractsWithSockets, SerializesModels;

    public $client;

    /**
     * Create a new event instance.
     *
     * @param Client $client
     */
    public function __construct(Client $client)
    {
        $this->client = $client;
    }

    /**
     * Get the channels the event should broadcast on.
     *
     * @return Channel|array
     */
    public function broadcastOn()
    {
        return new Channel('clients');
    }
}

BroadcastingManager.php发送错误的代码:

$this->app->make('queue')->connection($connection)->pushOn(
    $queue, BroadcastEvent::class, ['event' => serialize(clone $event)]
);

任何帮助表示感谢。

1 个答案:

答案 0 :(得分:1)

删除extends Event解决。