PHP code example of kybdev / laravel-chat-component

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

    

kybdev / laravel-chat-component example snippets


'connections' => [
    // Other connections...

    'chat' => [
        'driver' => 'sqlite',
        'database' => database_path('chat.sqlite'),
        'prefix' => '',
        'foreign_key_constraints' => true,
    ],
],

use Vendor\LaravelChat\Services\ConversationService;

$chat = app(ConversationService::class);

$conversation = $chat->createConversation([
    'subject' => 'Project discussion',
    'type' => 'group',
]);

$chat->addParticipant($conversation, $firstUserId);
$chat->addParticipant($conversation, $secondUserId);
sh
php artisan vendor:publish --tag=laravel-chat-config
sh
php artisan migrate --database=chat --path=vendor/kybdev/laravel-chat-component/database/migrations
sh
php artisan vendor:publish --tag=laravel-chat-assets
sh
php artisan vendor:publish --tag=laravel-chat-views