-
Notifications
You must be signed in to change notification settings - Fork 197
Open
Description
Echo Version
2.1.6
Laravel Version
12.16
PHP Version
8.4
NPM Version
10.9.2
Database Driver & Version
MySQL
Description
In order to make use of laravels ->toOthers()
broadcasting filter it is necessary to include the Socket-ID
in each request sent by inertia. See docs.
The current implementation of the hook does not seem to do this, so the filtering will not work properly.
A workaround for this issue is to manually set the header before an inertia request is sent:
import { echo } from '@laravel/echo-vue';
router.on('before', (event) => {
const id = echo().socketId();
if (!id) return;
event.detail.visit.headers['X-Socket-ID'] = id;
});
Steps To Reproduce
Setup a laravel application with broadcasting, dispatch an event via inertia request with ->toOthers()
and observe the missing X-Socket-ID
header in the inertia request
Metadata
Metadata
Assignees
Labels
No labels