PHP code example of emincmg / convo-lite

1. Go to this page and download the library: Download emincmg/convo-lite 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/ */

    

emincmg / convo-lite example snippets


'user_model' => config('auth.providers.users.model','App\\Models\\User.php'),

return [
    'new_message_subject' => 'New message notification from :sender',
    'greeting' => 'Dear :name,',
    'new_message_line' => 'You\'ve got a new message from :sender.',
    'click_to_view' => 'Click the button below to view.',
    'view_details' => 'Details',
    'best_regards' => 'Best Regards,',
    'slack_message' => 'You\'ve got a new message from :sender.',
    'view_message' => 'View Message',
    'sms_message' => 'You\'ve got a new message from :sender.',
];

$senderId= 1;
$receiverIds = [2,3];

Convo::createConversation($senderId,$receiverIds);

$conversation = Convo::getConversationById(1);
$conversation->setTitle('Test Title');

 Convo::createConversation($senderId,$receiverIds,'Test Title');

$conversation = Convo::getConversationById(1);

$conversation = Convo::getConversationById(1);
$userId = 1;

Convo::addParticipators($conversation, $userIds)

$conversationId = 1;
$userId = 1;

Convo::addParticipators($conversationId, $userId)

$conversationId = 1;
$userIds = [1,2,3,4];

Convo::addParticipators($conversationId, $userIds)

$conversationId = 1;
$message = Convo::sendMessage($conversationId,$user,'hello',$request->files());

$conversation = Convo::getConversationById(1);
$message = Convo::sendMessage($conversation,$user,'hello',$request->files());

$conversation = Convo::getConversationById(1);
$messages = Convo::getMessagesByConversation($conversation);

$conversation = Convo::getConversationById(1);
$conversation->messages;

'queues' => [
'mail' => 'convo-lite.mail',
'broadcast' => 'convo-lite.broadcast',
'slack' => 'convo-lite.slack',
'nexmo' => 'convo-lite.nexmo',
],
bash
php artisan migrate
bash
php artisan vendor:publish --provider="Emincmg\ConvoLite\Providers\ConversationServiceProvider"
bash
php artisan queue:work --queue=convo-lite.mail,convo-lite.broadcast,default