PHP code example of shalvah / pusher-chatkit-laravel
1. Go to this page and download the library: Download shalvah/pusher-chatkit-laravel 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/ */
// use whatever connection is default -- by default, this is 'main'
Chatkit::createRoom(['creator_id' =>'admin', 'name' => 'Just Chat']);
// use the 'main' connection
Chatkit::connection('main')->createRoom(['creator_id' =>'admin', 'name' => 'Just Chat']);
// use the 'test' connection
Chatkit::connection('test')->createRoom('admin', ['name' => 'Just Chat']);
// use the 'secondary' connection
Chatkit::setDefaultConnection('secondary');
Chatkit::createRoom(['creator_id' =>'admin', 'name' => 'Just Chat']);