venkatesanchinna / yii2-livechat
Online chat in the system
Installs: 866
Dependents: 0
Suggesters: 0
Security: 0
Stars: 4
Watchers: 1
Forks: 4
Open Issues: 1
Type:yii2-extension
Requires
- php: >=5.4.0
- yiisoft/yii2: *
This package is not auto-updated.
Last update: 2024-10-24 14:43:27 UTC
README
Online user chat for Yii
Features
- Easy text chat with system user
- Integrated with Yii2-livechat - flexible user online chat module
- Sample url : http://host/pathtoproject/backend/web/index.php?r=chat/livechat/view
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
-
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
-
To register chat module configuration avaible:
use venkatesanchinna\yii2livechat\assets\LivechatAsset; LivechatAsset::register($this);
-
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>
-
To Call the chat
$this->registerJs(' $().juichat({\'display_viewers\': true});');
-
Demo Users
Username : user1 & user2 Password : user1 & user2
-
Note
+ This will work after login to the site so check the condition where loading the chat ui and script
License
MIT