PHP code example of sunarctech / laravel-chat

1. Go to this page and download the library: Download sunarctech/laravel-chat 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/ */

    

sunarctech / laravel-chat example snippets


php artisan vendor:publish --provider="BeyondCode\LaravelWebSockets\WebSocketsServiceProvider" --tag="config" --tag="migrations"

'enable_client_messages' => 'true',

'pusher' => [
    'driver' => 'pusher',
    'key' => env('PUSHER_APP_KEY'),
    'secret' => env('PUSHER_APP_SECRET'),
    'app_id' => env('PUSHER_APP_ID'),
    'options' => [
        'cluster' => env('PUSHER_APP_CLUSTER'),
        'useTLS' => true,
        'host' => '127.0.0.1',
        'port' => 6001,
        'scheme' => 'http',
    ],
],


/*
* Application Service Providers...
*/
...
App\Providers\BroadcastServiceProvider::class,
...

php artisan migrate

php artisan storage:link

php artisan websocket:serve

www.yourdomain.com/chat

php artisan chat:install