79269411

Date: 2024-12-10 18:51:36
Score: 1
Natty:
Report link

I 've fixed broadcasting/auth by commenting out channels:... in app.php and putting in AppServiceProvider this

Broadcast::routes(['middleware' => ['auth:sanctum']]);

    Broadcast::channel('App.Models.User.{id}', function ($user, $id) {
        return (int) $user->id === (int) $id;
    });
    Broadcast::channel('user.{toUserId}', function ($user, $toUserId) {
        return $user->id == $toUserId;
    });
Reasons:
  • Has code block (-0.5):
  • Self-answer (0.5):
  • Low reputation (1):
Posted by: Eugene B.