venkatesanchinna/yii2-livechat

Online chat in the system


Keywords
chat, yii2, Live Chat, livechat, live-chat, online-chat, online chat, yii chat, yii2 chat
License
MIT

Documentation

Yii2 Live Chat

Latest Stable Version License Total Downloads Monthly Downloads Daily Downloads

Online user chat for Yii

Features

Installation

The preferred way to install this extension is through composer.

Either run

php composer.phar require --prefer-dist venkatesanchinna/yii2-livechat "*"

or run

composer require venkatesanchinna/yii2-livechat

or add

"venkatesanchinna/yii2-livechat": "*"

to the require section of your composer.json file.

Usage

  1. Let 's add into modules config in your main config file

        'modules' => [
            'chat' => [
                'class' => 'venkatesanchinna\yii2livechat\Module'
            ]
        ]
    
    

    Next, update the database schema

    $ php yii migrate/up --migrationPath=@vendor/venkatesanchinna/yii2-livechat/migrations
    
    

    Ok. That's done. Avaiable route now:

    • /chat/livechat/view
  2. To register chat module configuration avaible:

    
    use venkatesanchinna\yii2livechat\assets\LivechatAsset;
    LivechatAsset::register($this);
    
  3. To load the chat view in your website

    Add in view
    
    <div class="book_appointment ui-lc-viewers plus-minus">
        <div class="book_head " style="bottom: 0px; opacity: 1; width: 322px;">
            <span class="header_content book_app txtcap"></span> <span class=" fa fa-plus plus "></span>
            <div class="clear"></div>
        </div>
        <div class="book_form " >
            <div class="ui-container" style="bottom: -280px; opacity: 1;"></div>
        </div>
    </div>
    
    
  4. To Call the chat

    
        $this->registerJs(' $().juichat({\'display_viewers\': true});'); 
  5. Demo Users

    
    Username    : user1 & user2
    Password    : user1 & user2
    
    
  6. Note

    
    + This will work after login to the site so check the condition where loading the chat ui and script
    
    

License

MIT