“Webavel Websockets” Código de respuesta

Laravel WebSockets Onclose

// Add websocket routes "App\Providers\RouteServiceProvider.php"
public function map()
{
    $this->mapApiRoutes();

    $this->mapWebRoutes();
  
    $this->app->singleton('websockets.router', function () {
        return new Router();
    });
}

// Create WebSocket Router "App\WebSockets\Route.php"
class Router extends \BeyondCode\LaravelWebSockets\Server\Router
{
    public function echo()
    {
        $this->get('/app/{appKey}', WebSocketHandler::class);
        $this->post('/apps/{appId}/events', TriggerEventController::class);
        $this->get('/apps/{appId}/channels', FetchChannelsController::class);
        $this->get('/apps/{appId}/channels/{channelName}', FetchChannelController::class);
        $this->get('/apps/{appId}/channels/{channelName}/users', FetchUsersController::class);
    }
}

// Create WebSocket Router "App\WebSockets\WebSocketHandler.php"
class WebSocketHandler extends \BeyondCode\LaravelWebSockets\WebSockets\WebSocketHandler
{
    public function onClose(ConnectionInterface $connection, MessageInterface $message)
    {
        parent::onClose($connection, $message);
      	// Your code here...
    }
}
TheDutchScorpion

Laravel 8 websockets

you can watch the full video: https://www.youtube.com/watch?v=rNOGLLPXzwc
Shadow

Webavel Websockets

composer require beyondcode/laravel-websockets
Green Team

empujador de webavelsockets

you should remove the node_modules folder and then change package.json manually and downgrade the version of this ( "pusher-js": "^4.3.1" ) then install again with npm install.
Obnoxious Osprey

Respuestas similares a “Webavel Websockets”

Explore las respuestas de código populares por idioma

Explorar otros lenguajes de código