From 4f4bb4fd2b85c1c718e198c30bb99cea02868d13 Mon Sep 17 00:00:00 2001 From: Vagner do Carmo Date: Sat, 9 May 2015 04:13:10 -0300 Subject: [PATCH] update readme --- README.md | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index a271356..07cdada 100644 --- a/README.md +++ b/README.md @@ -96,10 +96,21 @@ node socket.js On your Lumen App: ```php +$app->get('/publish', function() { + publish('channel', 'awesome-event', 'An message'); + publish('channel', 'awesome-event', ['message' => 'An message', 'user' => \App\User::first()]); +}); + -publish('channel', 'awesome-event', 'An message'); +//or, in your controller or some else method (using Dependency Injection) -publish('channel', 'awesome-event', ['message' => 'An message', 'user' => \App\User::first()]); +public function publishSomethingAwesome(\Vluzrmos\Socketio\Broadcast $broadcast){ + $broadcast->publish('channel', 'awesome-event', 'An message'); + + // or just use the helper without inject \Vluzrmos\Socketio\Broadcast + + publish('channel', 'awesome-event', 'An message'); +} ```