1. Go to this page and download the library: Download phpfacile/chat-db 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 PHPFacile\Chat\Service\ChatChannelServiceInterface;
class CustomChatChannelService implements ChatChannelServiceInterface
{
public function isUserAllowedToAccessChannelMessages($userId, $channelId, $right)
{
// Return true if the user must be allowed to access
// to the content of the chat channel either for
// reading ($right = self::RIGHT_CHANNEL_MSG_READ) or for
// writing ($right = self::RIGHT_CHANNEL_MSG_WRITE)
return true;
}
}
$chatChannelService = new CustomChatChannelService();