@@ -12,15 +12,15 @@ |
||
| 12 | 12 | | |
| 13 | 13 | */ |
| 14 | 14 | |
| 15 | -Websocket::on('connect', function ($websocket, Request $request) { |
|
| 15 | +Websocket::on('connect', function($websocket, Request $request) { |
|
| 16 | 16 | // called while socket on connect |
| 17 | 17 | }); |
| 18 | 18 | |
| 19 | -Websocket::on('disconnect', function ($websocket) { |
|
| 19 | +Websocket::on('disconnect', function($websocket) { |
|
| 20 | 20 | // called while socket on disconnect |
| 21 | 21 | }); |
| 22 | 22 | |
| 23 | -Websocket::on('example', function ($websocket, $data) { |
|
| 23 | +Websocket::on('example', function($websocket, $data) { |
|
| 24 | 24 | $websocket->emit('message', $data); |
| 25 | 25 | }); |
| 26 | 26 | |
@@ -11,7 +11,7 @@ |
||
| 11 | 11 | | |
| 12 | 12 | */ |
| 13 | 13 | |
| 14 | -Route::group(['namespace' => 'SwooleTW\Http\Controllers'], function () { |
|
| 14 | +Route::group(['namespace' => 'SwooleTW\Http\Controllers'], function() { |
|
| 15 | 15 | Route::get('socket.io', 'SocketIOController@upgrade'); |
| 16 | 16 | Route::post('socket.io', 'SocketIOController@reject'); |
| 17 | 17 | }); |