1. Go to this page and download the library: Download zhuk/laravel-intercom 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/ */
final class CommonIntercomNotification extends Notification implements NotificationInterface
{
use Queueable;
/**
* @var string
*/
private string $messageText;
/**
* @param string $message
*
* @return void
*/
public function __construct(string $message)
{
$this->messageText = $message;
}
/**
* @param mixed $notifiable
*
* @return array
*/
public function via($notifiable)
{
return ['intercom'];
}
/**
* @param mixed $notifiable
*
* @return IntercomMessage
*/
public function toIntercom($notifiable): MessageInterface
{
return new InappMessage($this->messageText);
}
}
final class User
{
use Notifiable;
// ...
public function routeNotificationForIntercom($notification): ContactInterface
{
return new GenericMessageContact($this->intercom_contact_id);
}
}
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.