Q:

CSRF token mismatch larave-echo-server with nuxt

i have realtime application in nuxt and laravel with laravel-echo-server
when i use this
window.Echo.channel(`laravel_database_test-channel`).listen(
        "TestEvent",
        e => {
          console.log(e);
        }
      );

everything works fine
but when i try in private channel like this
window.Echo.private(`laravel_database_test-channel`).listen(
        "TestEvent",
        e => {
          console.log(e);
        }
      );

getting error "message": "CSRF token mismatch."
here is full screenshot

A:

goto App\Providers\BroadcastServiceProvider modify this
Broadcast::routes();

to
Broadcast::routes(['prefix' => 'api', 'middleware' => ['auth:api']]);

and in your laravel-echo-server.json
edit this
"authEndpoint": "/api/broadcasting/auth",

this helps me and working fine

