Skip to content

Commit

Permalink
remove another duplicate section (laravel#9515)
Browse files Browse the repository at this point in the history
39cbb5d introduced multiple duplicate sections. 0e27d90 fixed one of them. This fixes another
  • Loading branch information
adrum authored Mar 18, 2024
1 parent aa194f0 commit 771a047
Showing 1 changed file with 0 additions and 39 deletions.
39 changes: 0 additions & 39 deletions broadcasting.md
Original file line number Diff line number Diff line change
Expand Up @@ -211,45 +211,6 @@ The `install:broadcasting` Artisan command automatically installs the `laravel-e
npm install --save-dev laravel-echo pusher-js
```
Once `laravel-echo` and `pusher-js` are installed, you are ready to create a fresh Echo instance in your application's JavaScript. The `install:broadcasting` Artisan command creates a `resources/js/echo.js` file that handles this for you:
```js
import Echo from 'laravel-echo';

import Pusher from 'pusher-js';
window.Pusher = Pusher;

window.Echo = new Echo({
broadcaster: 'reverb',
key: import.meta.env.VITE_REVERB_APP_KEY,
wsHost: import.meta.env.VITE_REVERB_HOST,
wsPort: import.meta.env.VITE_REVERB_PORT,
wssPort: import.meta.env.VITE_REVERB_PORT,
forceTLS: (import.meta.env.VITE_REVERB_SCHEME ?? 'https') === 'https',
enabledTransports: ['ws', 'wss'],
});
```
Next, you only need to compile your application's assets:
```shell
npm run build
```
> [!NOTE]
> To learn more about compiling your application's JavaScript assets, please consult the documentation on [Vite](/docs/{{version}}/vite).
<a name="client-pusher-channels"></a>
### Pusher Channels
[Laravel Echo](https://github.com/laravel/echo) is a JavaScript library that makes it painless to subscribe to channels and listen for events broadcast by your server-side broadcasting driver. Echo also leverages the `pusher-js` NPM package to implement the Pusher protocol for WebSocket subscriptions, channels, and messages.
The `install:broadcasting` Artisan command automatically installs the `laravel-echo` and `pusher-js` packages for you; however, you may also install these packages manually via NPM:
```shell
npm install --save-dev laravel-echo pusher-js
```
Once Echo is installed, you are ready to create a fresh Echo instance in your application's JavaScript. The `install:broadcasting` command creates an Echo configuration file at `resources/js/echo.js`; however, the default configuration in this file is intended for Laravel Reverb. You may copy the configuration below to transition your configuration to Pusher:
```js
Expand Down

0 comments on commit 771a047

Please sign in to comment.