PHP code example of ehsan-nosair / chativel

1. Go to this page and download the library: Download ehsan-nosair/chativel 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/ */

    

ehsan-nosair / chativel example snippets


// ...
 
'echo' => [
    'broadcaster' => 'reverb',
    'key' => env('VITE_REVERB_APP_KEY'),
    'cluster' => env('VITE_REVERB_APP_CLUSTER'),
    'wsHost' => env('VITE_REVERB_HOST'),
    'wsPort' => env('VITE_REVERB_PORT'),
    'wssPort' => env('VITE_REVERB_PORT'),
    'authEndpoint' => '/broadcasting/auth',
    'disableStats' => true,
    'encrypted' => true,
    'forceTLS' => false,
],
 
// ...



use EhsanNosair\Chativel\Traits\Chatable;

class User extends Authenticatable
{
    use Chatable;
}

    
    // ...
    'chatables' => [
        \App\Models\User::class,
    ],
    // ...



use EhsanNosair\Chativel\ChativelPlugin;

class AdminPanelProvider extends PanelProvider
{
    public function panel(Panel $panel): Panel
    {
        return $panel
            //...
            ->plugins([
                ChativelPlugin::make()
            ]);
    }
}

## Testing

bash
php artisan chativel:install
bash
php artisan filament:assets
js
content: [
    ...
    './vendor/ehsan-nosair/chativel/resources/views/**/**/*.blade.php',
    ...
]
bash
php artisan install:broadcasting
bash
php artisan reverb:start