Skip to content

Commit

Permalink
update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
vluzrmos committed May 9, 2015
1 parent dd39284 commit 4f4bb4f
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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');
}

```

Expand Down

0 comments on commit 4f4bb4f

Please sign in to comment.