We're a place where coders share, stay up-to-date and grow their careers.
Amazing!
@mankarsandesh thanks for sharing! by chance could you share the laravel side of this? An end to end example would be really helpful to me.
For backend channeling authentication you would have to specify that you are using Laravel sanctum like this, given I am using the api prefix I put this in routes/api.php:
Broadcast::routes(['middleware' => ['auth:sanctum']]);
And taking this route as example it should works:
Broadcast::channel('App.User.{id}', function ($user, $id) { return (int)$user->id === (int)$id; });
I hope this is the answer you were looking for
@eichgi I’ll have to give it a go - thanks for responding!
Amazing!
@mankarsandesh thanks for sharing! by chance could you share the laravel side of this? An end to end example would be really helpful to me.
For backend channeling authentication you would have to specify that you are using Laravel sanctum like this, given I am using the api prefix I put this in routes/api.php:
And taking this route as example it should works:
I hope this is the answer you were looking for
@eichgi I’ll have to give it a go - thanks for responding!