app/Providers/BroadcastServiceProvider.php
/**
     * Bootstrap any application services.
     *
     * @return void
     */
Bootstrap any application services.
@return void
Bootstrap any application services . @return void
public function boot()
    {
        Broadcast::routes(['middleware' => ['jwt.auth']]);
        Broadcast::channel('App.User.*', function ($user, $userId) {
            return $user->id === $userId;
        });
        Broadcast::channel('chat.{group_id}', function ($user, $group_id) {
            return auth()->check() && $user->isMember($group_id);
        });
        Broadcast::channel('chat-group', function ($user) {
            return auth()->check();
        });
    }
public function boot ( ) { Broadcast :: routes ( [ 'middleware' => [ 'jwt.auth' ] ] ) ; Broadcast :: channel ( 'App.User.*' , function ( $ user , $ userId ) { return $ user -> id === $ userId ; } ) ; Broadcast :: channel ( 'chat.{group_id}' , function ( $ user , $ group_id ) { return auth ( ) -> check ( ) && $ user -> isMember ( $ group_id ) ; } ) ; Broadcast :: channel ( 'chat-group' , function ( $ user ) { return auth ( ) -> check ( ) ; } ) ; }
Bootstrap any application services.
Bootstrap any application services .
/*
         * Authenticate the user's personal channel...
         */