PHP code example of relaystacks / conduit-php

1. Go to this page and download the library: Download relaystacks/conduit-php library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

relaystacks / conduit-php example snippets


use RelayStacks\Conduit\UnixSocketTransport;

$transport = new UnixSocketTransport(
    socketPath: '/home/user/laravel.sock',
    secret: 'your-shared-secret', // optional
);

$success = $transport->send('chat-room', 'NewMessage', [
    'user' => 'Alice',
    'text' => 'Hello!',
]);

public function send(string $channel, string $event, array $data = []): bool;
bash
composer