I have a private channel. And i can use it only if i authenticated on site. But in case of laravel passport i have no idea how it should be work. By default all what i need contains in cookies. What i have:
Broadcast::routes();
Broadcast::channel('App.User.{id}', function ($user, $id) {
return (int) $user->id === (int) $id;
});
Broadcast::routes(['middleware' => ['api']]);
have no effect.
How do I authenticate users through laravel passport, for that would be connected to a private channel websocket?
Unfortunately at the current moment the echo does not support authorization with the help of laravel passport, it is necessary to write your own sokket.io server.