{"action":"created","comment":{"url":"https://api.github.com/repos/jlndk/laravel-realtime/pulls/comments/65017636","id":65017636,"diff_hunk":"@@ -0,0 +1,46 @@\n+<?php\n+\n+namespace Jlndk\\LaravelRealtime\\Broadcasting;\n+\n+use Illuminate\\Contracts\\Broadcasting\\Broadcaster;\n+use Jlndk\\LaravelRealtime\\Peer\\Server;\n+\n+class RealtimeBroadcaster implements Broadcaster\n+{\n+    /**\n+     * @var Jlndk\\LaravelRealtime\\Peer\\Server\n+     */\n+    protected $server;\n+\n+    /**\n+     * Creates a new instance of RealtimeBroadcaster\n+     * @param Server $server The server we shold use to broadcast events\n+     */\n+    function __construct(Server $server)\n+    {\n+        $this->server = $server;\n+    }\n+\n+    /**\n+     * Returns the server\n+     * @return Jlndk\\LaravelRealtime\\Peer\\Server\n+     */\n+    function getServer() {\n+        return $this->server();\n+    }\n+\n+    /**\n+     * Broadcasts a given event to the websocket\n+     * @param  array  $channels The channels that the event will be broadcasted on\n+     * @param  [type] $event    The name of the event that will be broadcasted\n+     * @param  [type] $payload  The extra data that the event provides.\n+     * @return void           \n+     */\n+    function broadcast(array $channels, $event, array $payload = [])\n+    {\n+        $this->server->publish($channels, $event, $payload);","path":"src/Broadcasting/RealtimeBroadcaster.php","position":41,"original_position":41,"commit_id":"39c522240d2b9c3cc22e3c8bb25ea8b684db60aa","original_commit_id":"39c522240d2b9c3cc22e3c8bb25ea8b684db60aa","user":{"login":"jlndk","id":3009101,"avatar_url":"https://avatars.githubusercontent.com/u/3009101?v=3","gravatar_id":"","url":"https://api.github.com/users/jlndk","html_url":"https://github.com/jlndk","followers_url":"https://api.github.com/users/jlndk/followers","following_url":"https://api.github.com/users/jlndk/following{/other_user}","gists_url":"https://api.github.com/users/jlndk/gists{/gist_id}","starred_url":"https://api.github.com/users/jlndk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jlndk/subscriptions","organizations_url":"https://api.github.com/users/jlndk/orgs","repos_url":"https://api.github.com/users/jlndk/repos","events_url":"https://api.github.com/users/jlndk/events{/privacy}","received_events_url":"https://api.github.com/users/jlndk/received_events","type":"User","site_admin":false},"body":"In a later pull request, addressing issue #3, we should properly use the event name (Eg. `\\App\\Events\\TestEvent`) as the topic, rather than the channel given by laravel. \r\nThe laravel channel should be used as realms instead.","created_at":"2016-05-30T02:13:34Z","updated_at":"2016-05-30T02:13:34Z","html_url":"https://github.com/jlndk/laravel-realtime/pull/7#discussion_r65017636","pull_request_url":"https://api.github.com/repos/jlndk/laravel-realtime/pulls/7","_links":{"self":{"href":"https://api.github.com/repos/jlndk/laravel-realtime/pulls/comments/65017636"},"html":{"href":"https://github.com/jlndk/laravel-realtime/pull/7#discussion_r65017636"},"pull_request":{"href":"https://api.github.com/repos/jlndk/laravel-realtime/pulls/7"}}},"pull_request":{"url":"https://api.github.com/repos/jlndk/laravel-realtime/pulls/7","id":71844803,"html_url":"https://github.com/jlndk/laravel-realtime/pull/7","diff_url":"https://github.com/jlndk/laravel-realtime/pull/7.diff","patch_url":"https://github.com/jlndk/laravel-realtime/pull/7.patch","issue_url":"https://api.github.com/repos/jlndk/laravel-realtime/issues/7","number":7,"state":"open","locked":false,"title":"Added downstream communication","user":{"login":"jlndk","id":3009101,"avatar_url":"https://avatars.githubusercontent.com/u/3009101?v=3","gravatar_id":"","url":"https://api.github.com/users/jlndk","html_url":"https://github.com/jlndk","followers_url":"https://api.github.com/users/jlndk/followers","following_url":"https://api.github.com/users/jlndk/following{/other_user}","gists_url":"https://api.github.com/users/jlndk/gists{/gist_id}","starred_url":"https://api.github.com/users/jlndk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jlndk/subscriptions","organizations_url":"https://api.github.com/users/jlndk/orgs","repos_url":"https://api.github.com/users/jlndk/repos","events_url":"https://api.github.com/users/jlndk/events{/privacy}","received_events_url":"https://api.github.com/users/jlndk/received_events","type":"User","site_admin":false},"body":"This fixes issue #5 by adding the ability to broadcast any laravel events to clients.","created_at":"2016-05-30T01:51:34Z","updated_at":"2016-05-30T02:13:34Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e8d3a0360730dfde4dce4a25f975efe058fdae91","assignee":null,"milestone":{"url":"https://api.github.com/repos/jlndk/laravel-realtime/milestones/1","html_url":"https://github.com/jlndk/laravel-realtime/milestones/1.1%20%22Beta%22","labels_url":"https://api.github.com/repos/jlndk/laravel-realtime/milestones/1/labels","id":1781192,"number":1,"title":"1.1 \"Beta\"","description":"Before we can release 1.1, as the first beta, we need to have implemented all the basic features.\r\n\r\nWe also need to implement unit tests, to ensure the forward stability of this package.","creator":{"login":"jlndk","id":3009101,"avatar_url":"https://avatars.githubusercontent.com/u/3009101?v=3","gravatar_id":"","url":"https://api.github.com/users/jlndk","html_url":"https://github.com/jlndk","followers_url":"https://api.github.com/users/jlndk/followers","following_url":"https://api.github.com/users/jlndk/following{/other_user}","gists_url":"https://api.github.com/users/jlndk/gists{/gist_id}","starred_url":"https://api.github.com/users/jlndk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jlndk/subscriptions","organizations_url":"https://api.github.com/users/jlndk/orgs","repos_url":"https://api.github.com/users/jlndk/repos","events_url":"https://api.github.com/users/jlndk/events{/privacy}","received_events_url":"https://api.github.com/users/jlndk/received_events","type":"User","site_admin":false},"open_issues":6,"closed_issues":0,"state":"open","created_at":"2016-05-22T16:15:57Z","updated_at":"2016-05-30T01:53:50Z","due_on":null,"closed_at":null},"commits_url":"https://api.github.com/repos/jlndk/laravel-realtime/pulls/7/commits","review_comments_url":"https://api.github.com/repos/jlndk/laravel-realtime/pulls/7/comments","review_comment_url":"https://api.github.com/repos/jlndk/laravel-realtime/pulls/comments{/number}","comments_url":"https://api.github.com/repos/jlndk/laravel-realtime/issues/7/comments","statuses_url":"https://api.github.com/repos/jlndk/laravel-realtime/statuses/39c522240d2b9c3cc22e3c8bb25ea8b684db60aa","head":{"label":"jlndk:downstream-communication","ref":"downstream-communication","sha":"39c522240d2b9c3cc22e3c8bb25ea8b684db60aa","user":{"login":"jlndk","id":3009101,"avatar_url":"https://avatars.githubusercontent.com/u/3009101?v=3","gravatar_id":"","url":"https://api.github.com/users/jlndk","html_url":"https://github.com/jlndk","followers_url":"https://api.github.com/users/jlndk/followers","following_url":"https://api.github.com/users/jlndk/following{/other_user}","gists_url":"https://api.github.com/users/jlndk/gists{/gist_id}","starred_url":"https://api.github.com/users/jlndk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jlndk/subscriptions","organizations_url":"https://api.github.com/users/jlndk/orgs","repos_url":"https://api.github.com/users/jlndk/repos","events_url":"https://api.github.com/users/jlndk/events{/privacy}","received_events_url":"https://api.github.com/users/jlndk/received_events","type":"User","site_admin":false},"repo":{"id":59384799,"name":"laravel-realtime","full_name":"jlndk/laravel-realtime","owner":{"login":"jlndk","id":3009101,"avatar_url":"https://avatars.githubusercontent.com/u/3009101?v=3","gravatar_id":"","url":"https://api.github.com/users/jlndk","html_url":"https://github.com/jlndk","followers_url":"https://api.github.com/users/jlndk/followers","following_url":"https://api.github.com/users/jlndk/following{/other_user}","gists_url":"https://api.github.com/users/jlndk/gists{/gist_id}","starred_url":"https://api.github.com/users/jlndk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jlndk/subscriptions","organizations_url":"https://api.github.com/users/jlndk/orgs","repos_url":"https://api.github.com/users/jlndk/repos","events_url":"https://api.github.com/users/jlndk/events{/privacy}","received_events_url":"https://api.github.com/users/jlndk/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jlndk/laravel-realtime","description":"A realtime library for laravel without compromises, using WAMPv2!","fork":false,"url":"https://api.github.com/repos/jlndk/laravel-realtime","forks_url":"https://api.github.com/repos/jlndk/laravel-realtime/forks","keys_url":"https://api.github.com/repos/jlndk/laravel-realtime/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jlndk/laravel-realtime/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jlndk/laravel-realtime/teams","hooks_url":"https://api.github.com/repos/jlndk/laravel-realtime/hooks","issue_events_url":"https://api.github.com/repos/jlndk/laravel-realtime/issues/events{/number}","events_url":"https://api.github.com/repos/jlndk/laravel-realtime/events","assignees_url":"https://api.github.com/repos/jlndk/laravel-realtime/assignees{/user}","branches_url":"https://api.github.com/repos/jlndk/laravel-realtime/branches{/branch}","tags_url":"https://api.github.com/repos/jlndk/laravel-realtime/tags","blobs_url":"https://api.github.com/repos/jlndk/laravel-realtime/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jlndk/laravel-realtime/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jlndk/laravel-realtime/git/refs{/sha}","trees_url":"https://api.github.com/repos/jlndk/laravel-realtime/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jlndk/laravel-realtime/statuses/{sha}","languages_url":"https://api.github.com/repos/jlndk/laravel-realtime/languages","stargazers_url":"https://api.github.com/repos/jlndk/laravel-realtime/stargazers","contributors_url":"https://api.github.com/repos/jlndk/laravel-realtime/contributors","subscribers_url":"https://api.github.com/repos/jlndk/laravel-realtime/subscribers","subscription_url":"https://api.github.com/repos/jlndk/laravel-realtime/subscription","commits_url":"https://api.github.com/repos/jlndk/laravel-realtime/commits{/sha}","git_commits_url":"https://api.github.com/repos/jlndk/laravel-realtime/git/commits{/sha}","comments_url":"https://api.github.com/repos/jlndk/laravel-realtime/comments{/number}","issue_comment_url":"https://api.github.com/repos/jlndk/laravel-realtime/issues/comments{/number}","contents_url":"https://api.github.com/repos/jlndk/laravel-realtime/contents/{+path}","compare_url":"https://api.github.com/repos/jlndk/laravel-realtime/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jlndk/laravel-realtime/merges","archive_url":"https://api.github.com/repos/jlndk/laravel-realtime/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jlndk/laravel-realtime/downloads","issues_url":"https://api.github.com/repos/jlndk/laravel-realtime/issues{/number}","pulls_url":"https://api.github.com/repos/jlndk/laravel-realtime/pulls{/number}","milestones_url":"https://api.github.com/repos/jlndk/laravel-realtime/milestones{/number}","notifications_url":"https://api.github.com/repos/jlndk/laravel-realtime/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jlndk/laravel-realtime/labels{/name}","releases_url":"https://api.github.com/repos/jlndk/laravel-realtime/releases{/id}","deployments_url":"https://api.github.com/repos/jlndk/laravel-realtime/deployments","created_at":"2016-05-21T22:47:59Z","updated_at":"2016-05-22T14:04:00Z","pushed_at":"2016-05-30T02:07:10Z","git_url":"git://github.com/jlndk/laravel-realtime.git","ssh_url":"git@github.com:jlndk/laravel-realtime.git","clone_url":"https://github.com/jlndk/laravel-realtime.git","svn_url":"https://github.com/jlndk/laravel-realtime","homepage":null,"size":26,"stargazers_count":3,"watchers_count":3,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":6,"forks":0,"open_issues":6,"watchers":3,"default_branch":"master"}},"base":{"label":"jlndk:v1.1-dev","ref":"v1.1-dev","sha":"5175e22d4b08937d911b55526652104908dc79e1","user":{"login":"jlndk","id":3009101,"avatar_url":"https://avatars.githubusercontent.com/u/3009101?v=3","gravatar_id":"","url":"https://api.github.com/users/jlndk","html_url":"https://github.com/jlndk","followers_url":"https://api.github.com/users/jlndk/followers","following_url":"https://api.github.com/users/jlndk/following{/other_user}","gists_url":"https://api.github.com/users/jlndk/gists{/gist_id}","starred_url":"https://api.github.com/users/jlndk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jlndk/subscriptions","organizations_url":"https://api.github.com/users/jlndk/orgs","repos_url":"https://api.github.com/users/jlndk/repos","events_url":"https://api.github.com/users/jlndk/events{/privacy}","received_events_url":"https://api.github.com/users/jlndk/received_events","type":"User","site_admin":false},"repo":{"id":59384799,"name":"laravel-realtime","full_name":"jlndk/laravel-realtime","owner":{"login":"jlndk","id":3009101,"avatar_url":"https://avatars.githubusercontent.com/u/3009101?v=3","gravatar_id":"","url":"https://api.github.com/users/jlndk","html_url":"https://github.com/jlndk","followers_url":"https://api.github.com/users/jlndk/followers","following_url":"https://api.github.com/users/jlndk/following{/other_user}","gists_url":"https://api.github.com/users/jlndk/gists{/gist_id}","starred_url":"https://api.github.com/users/jlndk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jlndk/subscriptions","organizations_url":"https://api.github.com/users/jlndk/orgs","repos_url":"https://api.github.com/users/jlndk/repos","events_url":"https://api.github.com/users/jlndk/events{/privacy}","received_events_url":"https://api.github.com/users/jlndk/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jlndk/laravel-realtime","description":"A realtime library for laravel without compromises, using WAMPv2!","fork":false,"url":"https://api.github.com/repos/jlndk/laravel-realtime","forks_url":"https://api.github.com/repos/jlndk/laravel-realtime/forks","keys_url":"https://api.github.com/repos/jlndk/laravel-realtime/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jlndk/laravel-realtime/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jlndk/laravel-realtime/teams","hooks_url":"https://api.github.com/repos/jlndk/laravel-realtime/hooks","issue_events_url":"https://api.github.com/repos/jlndk/laravel-realtime/issues/events{/number}","events_url":"https://api.github.com/repos/jlndk/laravel-realtime/events","assignees_url":"https://api.github.com/repos/jlndk/laravel-realtime/assignees{/user}","branches_url":"https://api.github.com/repos/jlndk/laravel-realtime/branches{/branch}","tags_url":"https://api.github.com/repos/jlndk/laravel-realtime/tags","blobs_url":"https://api.github.com/repos/jlndk/laravel-realtime/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jlndk/laravel-realtime/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jlndk/laravel-realtime/git/refs{/sha}","trees_url":"https://api.github.com/repos/jlndk/laravel-realtime/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jlndk/laravel-realtime/statuses/{sha}","languages_url":"https://api.github.com/repos/jlndk/laravel-realtime/languages","stargazers_url":"https://api.github.com/repos/jlndk/laravel-realtime/stargazers","contributors_url":"https://api.github.com/repos/jlndk/laravel-realtime/contributors","subscribers_url":"https://api.github.com/repos/jlndk/laravel-realtime/subscribers","subscription_url":"https://api.github.com/repos/jlndk/laravel-realtime/subscription","commits_url":"https://api.github.com/repos/jlndk/laravel-realtime/commits{/sha}","git_commits_url":"https://api.github.com/repos/jlndk/laravel-realtime/git/commits{/sha}","comments_url":"https://api.github.com/repos/jlndk/laravel-realtime/comments{/number}","issue_comment_url":"https://api.github.com/repos/jlndk/laravel-realtime/issues/comments{/number}","contents_url":"https://api.github.com/repos/jlndk/laravel-realtime/contents/{+path}","compare_url":"https://api.github.com/repos/jlndk/laravel-realtime/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jlndk/laravel-realtime/merges","archive_url":"https://api.github.com/repos/jlndk/laravel-realtime/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jlndk/laravel-realtime/downloads","issues_url":"https://api.github.com/repos/jlndk/laravel-realtime/issues{/number}","pulls_url":"https://api.github.com/repos/jlndk/laravel-realtime/pulls{/number}","milestones_url":"https://api.github.com/repos/jlndk/laravel-realtime/milestones{/number}","notifications_url":"https://api.github.com/repos/jlndk/laravel-realtime/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jlndk/laravel-realtime/labels{/name}","releases_url":"https://api.github.com/repos/jlndk/laravel-realtime/releases{/id}","deployments_url":"https://api.github.com/repos/jlndk/laravel-realtime/deployments","created_at":"2016-05-21T22:47:59Z","updated_at":"2016-05-22T14:04:00Z","pushed_at":"2016-05-30T02:07:10Z","git_url":"git://github.com/jlndk/laravel-realtime.git","ssh_url":"git@github.com:jlndk/laravel-realtime.git","clone_url":"https://github.com/jlndk/laravel-realtime.git","svn_url":"https://github.com/jlndk/laravel-realtime","homepage":null,"size":26,"stargazers_count":3,"watchers_count":3,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":6,"forks":0,"open_issues":6,"watchers":3,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/jlndk/laravel-realtime/pulls/7"},"html":{"href":"https://github.com/jlndk/laravel-realtime/pull/7"},"issue":{"href":"https://api.github.com/repos/jlndk/laravel-realtime/issues/7"},"comments":{"href":"https://api.github.com/repos/jlndk/laravel-realtime/issues/7/comments"},"review_comments":{"href":"https://api.github.com/repos/jlndk/laravel-realtime/pulls/7/comments"},"review_comment":{"href":"https://api.github.com/repos/jlndk/laravel-realtime/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/jlndk/laravel-realtime/pulls/7/commits"},"statuses":{"href":"https://api.github.com/repos/jlndk/laravel-realtime/statuses/39c522240d2b9c3cc22e3c8bb25ea8b684db60aa"}}}}
{"actor":{"display_login":"jlndk"}}