1. Go to this page and download the library: Download boyo/mobica 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 Boyo\Mobica\MobicaMessage;
use Boyo\Mobica\MobicaSender;
class MyClass
{
public function myFunction()
{
$message = (new MobicaMessage())->to('359888888888')->channel('viber-sms')->sms('SMS text')->viber('Viber text');
$client = new MobicaSender();
$client->send($message);
}
}
use Boyo\Mobica\MobicaMessage;
class MyMessage extends MobicaMessage
{
public function __construct($data)
{
$this->id = $data->id; // your unique message id, add other parameters if needed
}
public function build() {
// set your sms text
$this->sms('SMS text');
// set your viber text
$this->viber('Viber text');
return $this;
}
}