为什么Laravel和Pusher没有在localhost上工作但是在生产上工作?

I'm making a little dating app where I use Pusher and Laravel. I use an event called NewMessage and listening on channel msg.{userId}. Listening works, however broadcasting events doesn't. It works on production though.

My code is as follows:

NewMessage.php

    public function __construct(Message $message, $toUserId, $conversation)
    {
        //
        $this->message = $message;
        $this->toUserId = $toUserId;
        $this->conversation = $conversation;
    }
    /**
     * Get the channels the event should broadcast on.
     *
     * @return Channel|array
     */
    public function broadcastOn()
    {
        return new PrivateChannel('msg.'.$this->toUserId);
    }
    public function broadcastAs()
    {
        return 'NewMessage';
    }

ConversationController.php

event(new NewMessage($message, $toUserId, $conversation));

enter image description here

in config/broadcasting.php i just set the encrypted to false and it works!