Skip to content

Commit 293ca60

Browse files
[12.x] explain how to manually activate broadcasting routes (#10908)
* explain how to manually activate broadcasting routes while the automatic attempts Laravel makes to activate broadcast routes cover a lot of cases, there are some it does not. this change adds an explanation on how to manually activate routes if the Laravel magic fails. * Update broadcasting.md --------- Co-authored-by: Taylor Otwell <taylor@laravel.com>
1 parent 614ac45 commit 293ca60

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

broadcasting.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -777,7 +777,15 @@ class ServerCreated implements ShouldBroadcast, ShouldDispatchAfterCommit
777777
778778
Private channels require you to authorize that the currently authenticated user can actually listen on the channel. This is accomplished by making an HTTP request to your Laravel application with the channel name and allowing your application to determine if the user can listen on that channel. When using [Laravel Echo](#client-side-installation), the HTTP request to authorize subscriptions to private channels will be made automatically.
779779
780-
When broadcasting is enabled, Laravel automatically registers the `/broadcasting/auth` route to handle authorization requests. The `/broadcasting/auth` route is automatically placed within the `web` middleware group.
780+
When broadcasting is installed Laravel attempts to automatically register the `/broadcasting/auth` route to handle authorization requests. If Laravel fails to automatically register these routes, you may register them manually in your application's `/bootstrap/app.php` file:
781+
782+
```php
783+
->withRouting(
784+
web: __DIR__.'/../routes/web.php',
785+
channels: __DIR__.'/../routes/channels.php',
786+
health: '/up',
787+
)
788+
```
781789
782790
<a name="defining-authorization-callbacks"></a>
783791
### Defining Authorization Callbacks

0 commit comments

Comments
 (0)