PHP code example of live-person-inc / live-engage-laravel
1. Go to this page and download the library: Download live-person-inc/live-engage-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/ */
live-person-inc / live-engage-laravel example snippets
$start = new Carbon('2018-06-01 08:00:00');
$end = new Carbon('2018-06-03 17:00:00');
$skills = [432,676];
$history = LiveEngage::engagementHistory($start, $end, $skills);
$history->next(); // one page
while ($next = $history->next()) { $history = history->merge($next) } // get all remaining data
$engagement = $history->find('3498290084'); // This is a collection, so random(), first(), last() all work as well
foreach ($engagement->transcript as $message) { // For messaging conversations, use messageRecords instead of transcript
echo $message . "\n"; // calling the message object as a string returns its text value
}
echo $message->time->format('Y-m-d'); //The all time properties are Carbon date objects.