Skip to content

Commit d314fd1

Browse files
committed
+ laravel upgrade
1 parent 3584d94 commit d314fd1

1 file changed

Lines changed: 11 additions & 17 deletions

File tree

docs/guides/laravel.md

Lines changed: 11 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Why choosing AnyCable over Reverb et al?
66

77
AnyCable is a battle-proofed real-time server that's been in production at scale for many years. It comes with extensive features set (reliability, various protocols support, observability tools, etc.) and it's **free to use**.
88

9-
You can use AnyCable server in a [Pusher mode](/anycable-go/pusher.md) or _natively_ using a custom broadcasting and Echo adapter. In the latter, you can benefit from such AnyCable features as streams history and resumable sessions (see [Reliable streams](/anycable-go/reliable_streams.md)).
9+
You can use AnyCable server in a [Pusher mode](/anycable-go/pusher.md) or _natively_ using a custom broadcasting and Echo adapter. In the latter, you can benefit from such AnyCable features as streams history and resumeable sessions (see [Reliable streams](/anycable-go/reliable_streams.md)).
1010

1111
## Pusher mode
1212

@@ -40,8 +40,6 @@ When running with this command, AnyCable automatically recognizes the following
4040

4141
## AnyCable mode
4242

43-
**IMPORTANT:** This feature is currently in progress. Coming soon!
44-
4543
> Check out our demo Laravel application to see the complete example: [laravel-anycable-demo][]
4644
4745
To fully benefit from AnyCable features, we recommend switching to use our [client library][anycable-client]. We also provide an Echo adapter that provides a familiar interface while using AnyCable JS SDK under the hood.
@@ -77,24 +75,17 @@ Now, install the `@anycable/echo` JS package and configure your Echo instance:
7775

7876
```js
7977
import Echo from "laravel-echo";
80-
import { createCable } from "@anycable/web";
81-
import EchoCable from "@anycable/echo";
82-
83-
// Example options
84-
const cableOptions = {
85-
protocol: "actioncable-v1-ext-json" // supports stream history and presence
86-
}
78+
import { EchoCable } from "@anycable/echo";
8779

8880
window.Echo = new Echo({
8981
broadcaster: EchoCable,
90-
cable: createCable(cableOptions),
82+
cableOptions: {
83+
url: url: import.meta.env.VITE_WEBSOCKET_URL || 'ws://localhost:8080/cable',
84+
},
9185
// other configuration options such as auth, etc
9286
});
9387
```
9488

95-
By default, AnyCable client looks up a WebSocket server URL from the `<meta name="cable-url">` tag on the page.
96-
You can also specify it explicitly in the options.
97-
9889
Finally, install AnyCable server. We provide a convenient Artisan command that automatically downloads (when necessary) and runs the server:
9990

10091
```sh
@@ -104,7 +95,8 @@ php artisan anycable:server
10495
You can specify AnyCable configuration in the `.env` file:
10596

10697
- `ANYCABLE_SECRET=secret`
107-
- `ANYCABLE_PUBLIC_STREAMS=true` (to enable public channels—they're disable by default)
98+
- `ANYCABLE_PUBLIC=true`: This MUST be set to true to allow connection (however, we highly recommend looking at the [JWT Authentication feature](/anycable-go/jwt_identification.md)).
99+
- `ANYCABLE_PUBLIC_STREAMS=true`: Enables public channels—they're disabled by default.
108100

109101
You can also create an `anycable.toml` configuration file to fine-tune your AnyCable server (see [docs](/anycable-go/configuration?id=configuration-files)).
110102

@@ -116,8 +108,10 @@ That's it! Run your Laravel application, launch AnyCable server, and you should
116108

117109
## Benchmarks
118110

119-
TBD
111+
You can find the benchmarks here: https://github.com/anycable/anycable-laravel/tree/master/benchmarks
112+
113+
_tl;dr AnyCable shows slightly better performance and lesser memory usage during broadcast benchmarks compared to Reverb; however, AnyCable handles connection avalanches much better_
120114

121115
[anycable-laravel]: https://github.com/anycable/anycable-laravel
122116
[laravel-anycable-demo]: https://github.com/anycable/larachat
123-
[anycable-client]: https://github.com/anycable/anycable-client
117+
[anycable-client]: https://github.com/anycable/anycable-client/tree/master/packages/echo

0 commit comments

Comments
 (0)