protected function buildRequest($verb, Connection $connection, $topic, $data = [], $params = null)
    {
        $uri = [
            'protocol'  => 'ws://',
            'host'      => $connection->WebSocket->request->getHost(),
            'port'      => ':' . config('twostream.websocket.port'),
            'path'      => '/' . trim($topic->getId(), '/') . (isset($params) ? '/' . implode('/', $params) : ''),
        ];
        $cookies = $connection->WebSocket->request->getCookies();
        array_forget($cookies, config('session.cookie')); // Make sure the normal Session Facade does not contain the client's Session.
        
        return Request::createFromBase(
            SymfonyRequest::create(
                implode($uri),
                strtoupper($verb),
                ['data' => $data], // params
                $cookies, // cookies
                [], // files
                [], // server
                null // content
            )
        );
    }
protected function buildRequest($verb, Connection $connection, $topic, $data = [], $params = null)
    {
        $uri = [
            'protocol'  => 'ws://',
            'host'      => $connection->WebSocket->request->getHost(),
            'port'      => ':' . config('twostream.websocket.port'),
            'path'      => '/' . trim($topic->getId(), '/') . (isset($params) ? '/' . implode('/', $params) : ''),
        ];
        $cookies = $connection->WebSocket->request->getCookies();
        array_forget($cookies, config('session.cookie')); // Make sure the normal Session Facade does not contain the client's Session.
        
        return Request::createFromBase(
            SymfonyRequest::create(
                implode($uri),
                strtoupper($verb),
                ['data' => $data], // params
                $cookies, // cookies
                [], // files
                [], // server
                null // content
            )
        );
    }
protected function buildRequest ( $ verb , Connection $ connection , $ topic , $ data = [ ] , $ params = null ) { $ uri = [ 'protocol' => 'ws://' , 'host' => $ connection -> WebSocket -> request -> getHost ( ) , 'port' => ':' . config ( 'twostream.websocket.port' ) , 'path' => '/' . trim ( $ topic -> getId ( ) , '/' ) . ( isset ( $ params ) ? '/' . implode ( '/' , $ params ) : '' ) , ] ; $ cookies = $ connection -> WebSocket -> request -> getCookies ( ) ; array_forget ( $ cookies , config ( 'session.cookie' ) ) ; // Make sure the normal Session Facade does not contain the client's Session. return Request :: createFromBase ( SymfonyRequest :: create ( implode ( $ uri ) , strtoupper ( $ verb ) , [ 'data' => $ data ] , // params $ cookies , // cookies [ ] , // files [ ] , // server null // content ) ) ; }
Build an \Illuminate\Http\Request object.

@param string $verb
@param \Ratchet\ConnectionInterface $connection
@param \Ratchet\Wamp\Topic $topic
@param array $data
@param array|null $params
@return \Illuminate\Http\Request
Build an \ Illuminate \ Http \ Request object .