From 2a4e5e1fabdd159eb827fa68905d670bc324f46c Mon Sep 17 00:00:00 2001 From: Andrew Brown Date: Mon, 10 Nov 2025 14:23:30 -0600 Subject: [PATCH 1/2] 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. --- broadcasting.md | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/broadcasting.md b/broadcasting.md index 1f22837e39..624bebe4b8 100644 --- a/broadcasting.md +++ b/broadcasting.md @@ -777,7 +777,17 @@ class ServerCreated implements ShouldBroadcast, ShouldDispatchAfterCommit 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. -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. +When broadcasting is installed Laravel attempts to automatically register the `/broadcasting/auth` route to handle authorization requests. If this fails you must activate them manually in your `/bootstrap/app.php` file. + +```php +->withRouting( + web: __DIR__.'/../routes/web.php', + channels: __DIR__.'/../routes/channels.php', + health: '/up', +) +``` + +The `/broadcasting/auth` route is automatically placed within the `web` middleware group. ### Defining Authorization Callbacks From 8baf56296ccb23617913b51ad8664657c7714a01 Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Mon, 10 Nov 2025 16:56:34 -0600 Subject: [PATCH 2/2] Update broadcasting.md --- broadcasting.md | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/broadcasting.md b/broadcasting.md index 624bebe4b8..2ab33065e4 100644 --- a/broadcasting.md +++ b/broadcasting.md @@ -777,7 +777,7 @@ class ServerCreated implements ShouldBroadcast, ShouldDispatchAfterCommit 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. -When broadcasting is installed Laravel attempts to automatically register the `/broadcasting/auth` route to handle authorization requests. If this fails you must activate them manually in your `/bootstrap/app.php` file. +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: ```php ->withRouting( @@ -787,8 +787,6 @@ When broadcasting is installed Laravel attempts to automatically register the `/ ) ``` -The `/broadcasting/auth` route is automatically placed within the `web` middleware group. - ### Defining Authorization Callbacks