Skip to content

Conversation

joetannenbaum
Copy link
Contributor

@joetannenbaum joetannenbaum commented Jul 25, 2025

This PR addresses several small bugs:

  • The import regex wasn't matching multi-line imports and imports that didn't end with a semi colon
  • Fixed a bug where we weren't injecting the Echo code into non-TS files
  • In order for the ->toOthers() to work, we now add the websocket ID to all Inertia requests as follows:
router.on('before', (event) => {
    const id = echo().socketId();

    if (id) {
        event.detail.visit.headers['X-Socket-ID'] = id;
    }
});

Fixes laravel/echo#447

@taylorotwell taylorotwell marked this pull request as draft July 26, 2025 14:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

useEcho hooks do not define `X-Socket-ID' on inertia requests

2 participants