This repository was archived by the owner on Mar 24, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +23
-1
lines changed Expand file tree Collapse file tree 1 file changed +23
-1
lines changed Original file line number Diff line number Diff line change @@ -164,7 +164,7 @@ Now, you can run the following command to start the **swoole_http_server**.
164
164
$ php artisan swoole:http start
165
165
```
166
166
167
- ## Get related instances in your project
167
+ ## Get Related Instances in Laravel
168
168
169
169
* Swoole\Http\Server: By ` SwooleTW\Http\Server\Facades\Server ` or ` app('swoole.server') `
170
170
@@ -205,6 +205,28 @@ Websocket::join('some room');
205
205
Websocket::leave('some room');
206
206
```
207
207
208
+ * SwooleTW\Http\Websocket\Rooms\RoomContract: By ` SwooleTW\Http\Websocket\Facades\Room ` or ` app('swoole.room') `
209
+
210
+ ``` php
211
+ // get all fds in a 'game' room
212
+ Room::getClients('game');
213
+
214
+ // get all rooms of fd 1
215
+ Room::getRooms(1);
216
+
217
+ // add fd 1 to a 'game' room
218
+ Room::add(1, 'room');
219
+
220
+ // add fd 1 to 'game' and 'test' rooms
221
+ Room::addAll(1, ['game', 'test']);
222
+
223
+ // delete fd 1 from a 'game' room
224
+ Room::delete(1, 'room');
225
+
226
+ // delete fd 1 from 'game' and 'test' rooms
227
+ Room::deleteAll(1, ['game', 'test']);
228
+ ```
229
+
208
230
## Nginx Configuration
209
231
210
232
> The support of swoole_http_server for Http is not complete. So, you should configure the domains via nginx proxy in your production environment.
You can’t perform that action at this time.
0 commit comments