{"action":"created","issue":{"url":"https://api.github.com/repos/tlaverdure/laravel-echo-server/issues/73","repository_url":"https://api.github.com/repos/tlaverdure/laravel-echo-server","labels_url":"https://api.github.com/repos/tlaverdure/laravel-echo-server/issues/73/labels{/name}","comments_url":"https://api.github.com/repos/tlaverdure/laravel-echo-server/issues/73/comments","events_url":"https://api.github.com/repos/tlaverdure/laravel-echo-server/issues/73/events","html_url":"https://github.com/tlaverdure/laravel-echo-server/issues/73","id":187328701,"number":73,"title":"socket io not brodcasting to javascript","user":{"login":"wyklif","id":12080230,"avatar_url":"https://avatars.githubusercontent.com/u/12080230?v=3","gravatar_id":"","url":"https://api.github.com/users/wyklif","html_url":"https://github.com/wyklif","followers_url":"https://api.github.com/users/wyklif/followers","following_url":"https://api.github.com/users/wyklif/following{/other_user}","gists_url":"https://api.github.com/users/wyklif/gists{/gist_id}","starred_url":"https://api.github.com/users/wyklif/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wyklif/subscriptions","organizations_url":"https://api.github.com/users/wyklif/orgs","repos_url":"https://api.github.com/users/wyklif/repos","events_url":"https://api.github.com/users/wyklif/events{/privacy}","received_events_url":"https://api.github.com/users/wyklif/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-11-04T13:07:22Z","updated_at":"2016-11-04T13:40:17Z","closed_at":null,"body":"i have pasted this from my post in stack overflow could you please assist? thanks\r\n\r\n\r\n\r\ni have an event SomeEvent.php\r\n\r\nlike so:\r\n\r\n```\r\n<?php\r\n\r\nnamespace App\\Events;\r\n\r\nuse Illuminate\\Broadcasting\\Channel;\r\nuse Illuminate\\Queue\\SerializesModels;\r\nuse Illuminate\\Broadcasting\\PrivateChannel;\r\nuse Illuminate\\Broadcasting\\PresenceChannel;\r\nuse Illuminate\\Broadcasting\\InteractsWithSockets;\r\nuse Illuminate\\Contracts\\Broadcasting\\ShouldBroadcast;\r\n\r\nclass SomeEvent  implements ShouldBroadcast\r\n{\r\n\r\n\r\n    use InteractsWithSockets, SerializesModels;\r\n\r\n   public $data;\r\n    /**\r\n     * Create a new event instance.\r\n     *\r\n     * @return void\r\n     */\r\n    public function __construct($array)\r\n    {\r\n        $this->data = $array;\r\n    }\r\n\r\n    /**\r\n     * Get the channels the event should broadcast on.\r\n     *\r\n     * @return Channel|array\r\n     */\r\n    public function broadcastOn()\r\n    {\r\n       return new PrivateChannel('channel-name');\r\n    }\r\n}\r\n```\r\n\r\ni have included the following in my bootstrap.js and compiled it with gulp\r\n\r\n```\r\nimport Echo from \"laravel-echo\"\r\n\r\nwindow.Echo = new Echo({\r\n    broadcaster: 'socket.io',\r\n    host: 'http://site.dev:6001'\r\n\r\n});\r\n\r\n\r\nwindow.Echo.private('channel-name')\r\n    .listen('SomeEvent', (e) => {\r\n        console.log(e);\r\n});\r\n\r\n```\r\n\r\nthen i have installed tlaverdure/laravel-echo-server and here is my laravel-echo-server.json\r\n\r\n```\r\n{\r\n    \"appKey\": \"[generated]\",\r\n    \"authHost\": \"http://site.dev\",\r\n    \"authEndpoint\": \"/broadcasting/auth\",\r\n    \"database\": \"redis\",\r\n    \"databaseConfig\": {\r\n        \"redis\": {},\r\n        \"sqlite\": {\r\n            \"databasePath\": \"/database/laravel-echo-server.sqlite\"\r\n        }\r\n    },\r\n    \"devMode\": false,\r\n    \"host\": \"site.dev\",\r\n    \"port\": \"6001\",\r\n    \"referrers\": [],\r\n    \"socketio\": {},\r\n    \"sslCertPath\": \"\",\r\n    \"sslKeyPath\": \"\"\r\n}\r\n```\r\n\r\nnow when i fire up laravel echo server with laravel-echo-server start it starts up very well however when i fire up the above event like so\r\n\r\nevent(new SomeEvent(json_encode(['name' => 'some-name'])));\r\n\r\ni can see the event published to redis however nothing is loged to my client console: i am also including socket io in my master.blade.php\r\n\r\nthe above also happens with notifications\r\n\r\nfrom turning to devmode i can see the following\r\n\r\n```\r\n[3:59:00 PM] - nsLfFMWWjC7b0DVaAAAC joined channel: channel-name.1\r\n[3:59:00 PM] - nsLfFMWWjC7b0DVaAAAC left channel: channel-name.1\r\n```\r\n\r\nany help will be highly appreciated. Thanks guys\r\n"},"comment":{"url":"https://api.github.com/repos/tlaverdure/laravel-echo-server/issues/comments/258433496","html_url":"https://github.com/tlaverdure/laravel-echo-server/issues/73#issuecomment-258433496","issue_url":"https://api.github.com/repos/tlaverdure/laravel-echo-server/issues/73","id":258433496,"user":{"login":"sidis405","id":844961,"avatar_url":"https://avatars.githubusercontent.com/u/844961?v=3","gravatar_id":"","url":"https://api.github.com/users/sidis405","html_url":"https://github.com/sidis405","followers_url":"https://api.github.com/users/sidis405/followers","following_url":"https://api.github.com/users/sidis405/following{/other_user}","gists_url":"https://api.github.com/users/sidis405/gists{/gist_id}","starred_url":"https://api.github.com/users/sidis405/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sidis405/subscriptions","organizations_url":"https://api.github.com/users/sidis405/orgs","repos_url":"https://api.github.com/users/sidis405/repos","events_url":"https://api.github.com/users/sidis405/events{/privacy}","received_events_url":"https://api.github.com/users/sidis405/received_events","type":"User","site_admin":false},"created_at":"2016-11-04T13:40:17Z","updated_at":"2016-11-04T13:40:17Z","body":"Apparently you have to put a dot in front of the event name you're listening for.\r\n```\r\nwindow.Echo.private('channel-name')\r\n    .listen('.SomeEvent', (e) => {\r\n        console.log(e);\r\n});\r\n```\r\n\r\nSeems related to custom namespaces.\r\nHope it helps."}}
{"actor":{"display_login":"sidis405"}}