Skip to content

Fix app entry point adjustments in Echo installation #56421

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 4 commits into
base: 12.x
Choose a base branch
from

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