I have a notification system in Laravel 11, and SPA Nuxt 3 connects in the browser using Laravel Echo and gets status 101. The notification is saved in the database and no errors appear, but the channel never receives anything and does not work at all
Here is the notification file code
<?php
namespace AppNotifications;
use IlluminateBusQueueable;
use IlluminateSupportFacadesLog;
use IlluminateBroadcastingChannel;
use IlluminateNotificationsNotification;
use IlluminateContractsBroadcastingShouldBroadcast;
use IlluminateNotificationsMessagesBroadcastMessage;
class sendContactNotification extends Notification implements ShouldBroadcast
{
use Queueable;
public $data;
public function __construct($data)
{
$this->data = $data;
}
public function via(object $notifiable): array
{
return ["database", "broadcast"];
}
public function toArray(object $notifiable): array
{
return [
'text' => $this->data,
];
}
public function toBroadcast($notifiable)
{
Log::info('toBroadcast run.');
$this->broadcastOn();
return new BroadcastMessage([
'message' => $this->data,
]);
}
public function broadcastOn()
{
Log::info('broadcastOn run.');
return new Channel('admin-notification-channel');
}
}
Indeed, these words are logged:
toBroadcast run.
broadcastOn run.
I directly call the notification from the controller like this:
$notificationRecipients = Admin::all();
$message = 'contact_us_notifications';
Notification::send($notificationRecipients, new sendContactNotification($message));
This is the channel:
Broadcast::channel('admin-notification-channel', function ($user) {
Log::info('channel run.');
return true;
});
I never find this word in the log:
“channel run.”
This is the Laravel Echo code in the front end:
import Echo from 'laravel-echo'
import Pusher from 'pusher-js'
export default defineNuxtPlugin(nuxtApp => {
const { $coreHttp } = useNuxtApp()
const config = useRuntimeConfig()
const pusher_const = Pusher
console.log("test run")
const echo_const = new Echo({
broadcaster: 'reverb',
key: config.public.REVERB_APP_KEY,
wsHost: config.public.REVERB_HOST,
wsPort: config.public.REVERB_PORT,
wssPort: config.public.REVERB_PORT,
forceTLS: (config.public.REVERB_SCHEME ?? 'https') === 'https',
enabledTransports: ['ws', 'wss'],
auth: {
headers: {
Authorization: `Bearer ${localStorage.getItem('authAdmin')}`,
Accept: 'application/json',
},
},
})
window.Pusher = pusher_const
window.Echo = pusher_const
nuxtApp.provide('pusher', pusher_const)
nuxtApp.provide('echo', echo_const)
})
The connection runs for the notification using Postman, and each step is saved in the log to check where it reached, as explained. However, the channel never works and is not saved in the log

